now the meta id of the meta variables is accessible via the PGF API

This commit is contained in:
krasimir
2010-07-31 12:52:20 +00:00
parent ebe5b87738
commit b227c8a586
2 changed files with 9 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ module PGF(
mkStr, unStr,
mkInt, unInt,
mkDouble, unDouble,
mkMeta, isMeta,
mkMeta, unMeta,
-- * Operations
-- ** Linearization

View File

@@ -5,7 +5,7 @@ module PGF.Expr(Tree, BindType(..), Expr(..), Literal(..), Patt(..), Equation(..
mkStr, unStr,
mkInt, unInt,
mkDouble, unDouble,
mkMeta, isMeta,
mkMeta, unMeta,
normalForm,
@@ -144,15 +144,15 @@ unDouble (EImplArg e) = unDouble e
unDouble _ = Nothing
-- | Constructs an expression which is meta variable
mkMeta :: Expr
mkMeta = EMeta 0
mkMeta :: Int -> Expr
mkMeta i = EMeta i
-- | Checks whether an expression is a meta variable
isMeta :: Expr -> Bool
isMeta (EMeta _) = True
isMeta (ETyped e ty) = isMeta e
isMeta (EImplArg e) = isMeta e
isMeta _ = False
unMeta :: Expr -> Maybe Int
unMeta (EMeta i) = Just i
unMeta (ETyped e ty) = unMeta e
unMeta (EImplArg e) = unMeta e
unMeta _ = Nothing
-----------------------------------------------------
-- Parsing