forked from GitHub/gf-core
added the concreteName function in the Haskell binding
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user