summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind')
-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.