summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorKrasimir Angelov <kr.angelov@gmail.com>2017-08-30 15:43:09 +0200
committerKrasimir Angelov <kr.angelov@gmail.com>2017-08-30 15:43:09 +0200
commit97fe5df267dc7e5611a5a93699d031727165bd2a (patch)
tree01f7498f9b397f2190be36eb789e50d9a859d6fd /src/runtime
parent19613a76ab843be9370ca250e5989e5980eaaadc (diff)
added the concreteName function in the Haskell binding
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/haskell-bind/PGF2.hsc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc
index 40d485b9a..104d06cb1 100644
--- a/src/runtime/haskell-bind/PGF2.hsc
+++ b/src/runtime/haskell-bind/PGF2.hsc
@@ -51,7 +51,7 @@ module PGF2 (-- * PGF
compute,
-- * Concrete syntax
- ConcName,Concr,languages,
+ ConcName,Concr,languages,concreteName,
-- ** Linearization
linearize,linearizeAll,tabularLinearize,bracketedLinearize,
FId, LIndex, BracketedString(..), showBracketedString, flattenBracketedString,
@@ -150,6 +150,11 @@ languages p =
concr <- fmap (\ptr -> Concr ptr (touchPGF p)) $ peek (castPtr value)
writeIORef ref $! Map.insert name concr langs
+-- | The abstract language name is the name of the top-level
+-- abstract module
+concreteName :: Concr -> ConcName
+concreteName c = unsafePerformIO (peekUtf8CString =<< pgf_concrete_name (concr c))
+
-- | Generates an exhaustive possibly infinite list of
-- all abstract syntax expressions of the given type.
-- The expressions are ordered by their probability.