Extend TyCons and DataCons to represent data instance decls
[ghc-hetmet.git] / compiler / iface / BinIface.hs
index 513bf20..ac28ddb 100644 (file)
@@ -913,7 +913,6 @@ instance Binary IfaceDecl where
            put_ bh a6
            put_ bh a7
            put_ bh a8
-
     put_ bh (IfaceSyn aq ar as at) = do
            putByte bh 3
            put_ bh aq
@@ -989,21 +988,25 @@ instance Binary OverlapFlag where
 
 instance Binary IfaceConDecls where
     put_ bh IfAbstractTyCon = putByte bh 0
-    put_ bh (IfDataTyCon cs) = do { putByte bh 1
+    put_ bh IfOpenDataTyCon = putByte bh 1
+    put_ bh IfOpenNewTyCon = putByte bh 2
+    put_ bh (IfDataTyCon cs) = do { putByte bh 3
                                  ; put_ bh cs }
-    put_ bh (IfNewTyCon c)  = do { putByte bh 2
+    put_ bh (IfNewTyCon c)  = do { putByte bh 4
                                  ; put_ bh c }
     get bh = do
            h <- getByte bh
            case h of
              0 -> return IfAbstractTyCon
-             1 -> do cs <- get bh
+             1 -> return IfOpenDataTyCon
+             2 -> return IfOpenNewTyCon
+             3 -> do cs <- get bh
                      return (IfDataTyCon cs)
              _ -> do aa <- get bh
                      return (IfNewTyCon aa)
 
 instance Binary IfaceConDecl where
-    put_ bh (IfCon a1 a2 a3 a4 a5 a6 a7 a8 a9) = do
+    put_ bh (IfCon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) = do
            put_ bh a1
            put_ bh a2
            put_ bh a3
@@ -1013,6 +1016,7 @@ instance Binary IfaceConDecl where
            put_ bh a7
            put_ bh a8
            put_ bh a9
+           put_ bh a10
     get bh = do a1 <- get bh
                a2 <- get bh
                a3 <- get bh          
@@ -1022,7 +1026,8 @@ instance Binary IfaceConDecl where
                a7 <- get bh
                a8 <- get bh
                a9 <- get bh
-               return (IfCon a1 a2 a3 a4 a5 a6 a7 a8 a9)
+               a10 <- get bh
+               return (IfCon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10)
 
 instance Binary IfaceClassOp where
    put_ bh (IfaceClassOp n def ty) = do