diff --git a/src/PGF.hs b/src/PGF.hs index 5cd499aec..6c192095d 100644 --- a/src/PGF.hs +++ b/src/PGF.hs @@ -46,7 +46,7 @@ module PGF( mkStr, unStr, mkInt, unInt, mkDouble, unDouble, - + mkMeta, isMeta, -- * Operations -- ** Linearization diff --git a/src/PGF/Expr.hs b/src/PGF/Expr.hs index bddbc84d4..cf0cb79aa 100644 --- a/src/PGF/Expr.hs +++ b/src/PGF/Expr.hs @@ -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 -----------------------------------------------------