1
0
forked from GitHub/gf-core

added mkMeta and isMeta in PGF

This commit is contained in:
krasimir
2009-12-05 10:12:03 +00:00
parent 65e9869f1a
commit 234247b2bd
2 changed files with 11 additions and 1 deletions

View File

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

View File

@@ -5,6 +5,7 @@ module PGF.Expr(Tree, BindType(..), Expr(..), Literal(..), Patt(..), Equation(..
mkStr, unStr,
mkInt, unInt,
mkDouble, unDouble,
mkMeta, isMeta,
normalForm,
@@ -132,6 +133,15 @@ unDouble :: Expr -> Maybe Double
unDouble (ELit (LFlt f)) = Just f
unDouble _ = Nothing
-- | Constructs an expression which is meta variable
mkMeta :: Expr
mkMeta = EMeta 0
-- | Checks whether an expression is a meta variable
isMeta :: Expr -> Bool
isMeta (EMeta _) = True
isMeta _ = False
-----------------------------------------------------
-- Parsing
-----------------------------------------------------