diff options
| author | aarne <aarne@chalmers.se> | 2012-02-24 10:00:27 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2012-02-24 10:00:27 +0000 |
| commit | aa7668ef752c0bf2419780b2ec7581a29fa3afd1 (patch) | |
| tree | 7cbdea38686bf05c63e9575ead1342577ac9873a /src/compiler/GF/Compile/Compute | |
| parent | be76d44b8f7761387b5f0f5df51298bd50a64af8 (diff) | |
the Predef function eqVal to compare equality of parameter values
Diffstat (limited to 'src/compiler/GF/Compile/Compute')
| -rw-r--r-- | src/compiler/GF/Compile/Compute/AppPredefined.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/GF/Compile/Compute/AppPredefined.hs b/src/compiler/GF/Compile/Compute/AppPredefined.hs index 514b471c4..be1008a47 100644 --- a/src/compiler/GF/Compile/Compute/AppPredefined.hs +++ b/src/compiler/GF/Compile/Compute/AppPredefined.hs @@ -77,6 +77,8 @@ primitives = Map.fromList [(Explicit,varP,typePType),(Explicit,identW,typeStr)] (Vr varP) []))) Nothing) , (cShow , ResOper (Just (noLoc (mkProd -- (P : PType) -> P -> Tok [(Explicit,varP,typePType),(Explicit,identW,Vr varP)] typeStr []))) Nothing) + , (cEqVal , ResOper (Just (noLoc (mkProd -- (P : PType) -> P -> P -> PBool + [(Explicit,varP,typePType),(Explicit,identW,Vr varP),(Explicit,identW,Vr varP)] typePBool []))) Nothing) , (cToStr , ResOper (Just (noLoc (mkProd -- (L : Type) -> L -> Str [(Explicit,varL,typeType),(Explicit,identW,Vr varL)] typeStr []))) Nothing) , (cMapStr , ResOper (Just (noLoc (mkProd -- (L : Type) -> (Str -> Str) -> L -> L @@ -135,6 +137,7 @@ appPredefined t = case t of (z,_) <- appPredefined z0 case (z, y, x) of (ty,op,t) | f == cMapStr -> retf $ mapStr ty op t + _ | f == cEqVal -> retb $ if y==x then predefTrue else predefFalse _ -> retb t ---- prtBad "cannot compute predefined" t _ -> retb t ---- prtBad "cannot compute predefined" t |
