@@ -24,7 +24,7 @@ import Debug.Trace
2424import Paths_idris
2525
2626ibcVersion :: Word8
27−ibcVersion = 31
27+ibcVersion = 32
2828
2929data IBCFile = IBCFile { ver :: Word8,
3030 sourcefile :: FilePath,
@@ -49,6 +49,7 @@ data IBCFile = IBCFile { ver :: Word8,
4949 ibc_cg :: [(Name, CGInfo)],
5050 ibc_defs :: [(Name, Def)],
5151 ibc_docstrings :: [(Name, String)],
52+ ibc_transforms :: [(Term, Term)],
5253 ibc_coercions :: [Name]
5354 }
5455 deriving Show
@@ -57,7 +58,7 @@ deriving instance Binary IBCFile
5758!-}
5859
5960initIBC :: IBCFile
60−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
61+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
6162
6263loadIBC :: FilePath -> Idris ()
6364loadIBC fp = do iLOG $ "Loading ibc " ++ fp
@@ -130,6 +131,7 @@ ibc i (IBCCoercion n) f = return f { ibc_coercions = n : ibc_coercions f }
130131ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
131132ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
132133ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
134+ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
133135
134136process :: IBCFile -> FilePath -> Idris ()
135137process i fn
@@ -162,6 +164,7 @@ process i fn
162164 pCG (ibc_cg i)
163165 pDocs (ibc_docstrings i)
164166 pCoercions (ibc_coercions i)
167+ pTrans (ibc_transforms i)
165168
166169timestampOlder :: FilePath -> FilePath -> IO ()
167170timestampOlder src ibc = do srct <- getModificationTime src
@@ -291,6 +294,9 @@ pCG ds = mapM_ (\ (n, a) -> addToCG n a) ds
291294pCoercions :: [Name] -> Idris ()
292295pCoercions ns = mapM_ (\ n -> addCoercion n) ns
293296
297+pTrans :: [(Term, Term)] -> Idris ()
298+pTrans ts = mapM_ addTrans ts
299+
294300----- Generated by 'derive'
295301
296302instance Binary SizeChange where
@@ -781,7 +787,7 @@ instance Binary Totality where
781787 _ -> error "Corrupted binary data for Totality"
782788
783789instance Binary IBCFile where
784− put x@(IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24)
790+ put x@(IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25)
785791 = {-# SCC "putIBCFile" #-}
786792 do put x1
787793 put x2
@@ -807,6 +813,7 @@ instance Binary IBCFile where
807813 put x22
808814 put x23
809815 put x24
816+ put x25
810817 get
811818 = do x1 <- get
812819 if x1 == ibcVersion then
@@ -833,7 +840,8 @@ instance Binary IBCFile where
833840 x22 <- get
834841 x23 <- get
835842 x24 <- get
836− return (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24)
843+ x25 <- get
844+ return (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25)
837845 else return (initIBC { ver = x1 })
838846
839847instance Binary FnOpt where