forked from GitHub/gf-core
added mkMeta and isMeta in PGF
This commit is contained in:
@@ -46,7 +46,7 @@ module PGF(
|
||||
mkStr, unStr,
|
||||
mkInt, unInt,
|
||||
mkDouble, unDouble,
|
||||
|
||||
mkMeta, isMeta,
|
||||
|
||||
-- * Operations
|
||||
-- ** Linearization
|
||||
|
||||
@@ -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
|
||||
-----------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user