From 067d908aa3f77e0690cceab442a26661eb1ae860 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 31 Jul 2010 12:52:20 +0000 Subject: now the meta id of the meta variables is accessible via the PGF API --- src/runtime/haskell/PGF/Expr.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/runtime/haskell/PGF') diff --git a/src/runtime/haskell/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs index 057678c70..2202a20c4 100644 --- a/src/runtime/haskell/PGF/Expr.hs +++ b/src/runtime/haskell/PGF/Expr.hs @@ -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 -- cgit v1.2.3