@@ -41,11 +41,23 @@ type Interfaces = Map.Map String ModuleInterface
41type ADT = (String, [String], [(String,[Type])])
41type ADT = (String, [String], [(String,[Type])])
43data ModuleInterface = ModuleInterface {
43data ModuleInterface = ModuleInterface {
44− iTypes :: Map.Map String Type,
44+ iTypes :: Map.Map String Type,
45− iAdts :: [ADT],
45+ iAdts :: [ADT],
46− iAliases :: [(String, [String], Type)]
46+ iAliases :: [(String, [String], Type)],
47+ iFixities :: [(Assoc, Int, String)]
47} deriving Show
48} deriving Show
49instance Binary ModuleInterface where
50instance Binary ModuleInterface where
51+ get = ModuleInterface <$> get <*> get <*> get <*> get
50− put modul = put (iTypes modul) >> put (iAdts modul) >> put (iAliases modul)
55+ put (iAliases modul)
51− get = ModuleInterface <$> get <*> get <*> get
56+ put (iFixities modul)
59+instance Binary Assoc where
60+ get = do n <- getWord8
61+ return $ case n of { 0 -> L ; 1 -> N ; 2 -> R }
63+ put assoc = putWord8 $ case assoc of { L -> 0 ; N -> 1 ; R -> 2 }