1
0
forked from GitHub/gf-core

added the concreteName function in the Haskell binding

This commit is contained in:
Krasimir Angelov
2017-08-30 15:43:09 +02:00
parent 19613a76ab
commit 97fe5df267

View File

@@ -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.