diff options
| author | krasimir <krasimir@chalmers.se> | 2010-07-31 12:52:20 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-07-31 12:52:20 +0000 |
| commit | 067d908aa3f77e0690cceab442a26661eb1ae860 (patch) | |
| tree | 59aff20560376c01e9c56f6a7e3427ceabb52061 /src/runtime | |
| parent | b351c9d9ddfddc6d419649b55f516d51cffbe0c6 (diff) | |
now the meta id of the meta variables is accessible via the PGF API
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/haskell/PGF.hs | 2 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Expr.hs | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs index c387521a7..652399f69 100644 --- a/src/runtime/haskell/PGF.hs +++ b/src/runtime/haskell/PGF.hs @@ -47,7 +47,7 @@ module PGF( mkStr, unStr, mkInt, unInt, mkDouble, unDouble, - mkMeta, isMeta, + mkMeta, unMeta, -- * Operations -- ** Linearization 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
|
