diff options
| author | krasimir <krasimir@chalmers.se> | 2009-09-20 11:43:41 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-09-20 11:43:41 +0000 |
| commit | b1a51f46f5d137ab4d65a4381b349af3291a944d (patch) | |
| tree | ce1df7a103ba74a9c8a7eedbf2260bde37736166 /src/PGF/Binary.hs | |
| parent | d09371280d5b28d85acce7b7d899c21bc4e11b32 (diff) | |
change the data types and the syntax in PGF to match the new syntax for implict arguments
Diffstat (limited to 'src/PGF/Binary.hs')
| -rw-r--r-- | src/PGF/Binary.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/PGF/Binary.hs b/src/PGF/Binary.hs index 87d61d1bc..e4ed98424 100644 --- a/src/PGF/Binary.hs +++ b/src/PGF/Binary.hs @@ -102,7 +102,7 @@ instance Binary Term where _ -> decodingError
instance Binary Expr where
- put (EAbs x exp) = putWord8 0 >> put (x,exp)
+ put (EAbs b x exp) = putWord8 0 >> put (b,x,exp)
put (EApp e1 e2) = putWord8 1 >> put (e1,e2)
put (ELit (LStr s)) = putWord8 2 >> put s
put (ELit (LFlt d)) = putWord8 3 >> put d
@@ -113,7 +113,7 @@ instance Binary Expr where put (ETyped e ty) = putWord8 8 >> put (e,ty)
get = do tag <- getWord8
case tag of
- 0 -> liftM2 EAbs get get
+ 0 -> liftM3 EAbs get get get
1 -> liftM2 EApp get get
2 -> liftM (ELit . LStr) get
3 -> liftM (ELit . LFlt) get
@@ -149,15 +149,14 @@ instance Binary Type where put (DTyp hypos cat exps) = put (hypos,cat,exps)
get = liftM3 DTyp get get get
-instance Binary Hypo where
- put (Hyp t) = putWord8 0 >> put t
- put (HypV v t) = putWord8 1 >> put (v,t)
- put (HypI v t) = putWord8 2 >> put (v,t)
+instance Binary BindType where
+ put Explicit = putWord8 0
+ put Implicit = putWord8 1
get = do tag <- getWord8
case tag of
- 0 -> liftM Hyp get
- 1 -> liftM2 HypV get get
- 2 -> liftM2 HypI get get
+ 0 -> return Explicit
+ 1 -> return Implicit
+ _ -> decodingError
instance Binary FFun where
put (FFun fun prof lins) = put (fun,prof,lins)
|
