@@ -24,7 +24,7 @@ import Debug.Trace
24import Paths_idris
24import Paths_idris
26ibcVersion :: Word8
26ibcVersion :: Word8
27−ibcVersion = 31
27+ibcVersion = 32
29data IBCFile = IBCFile { ver :: Word8,
29data IBCFile = IBCFile { ver :: Word8,
30 sourcefile :: FilePath,
30 sourcefile :: FilePath,
@@ -49,6 +49,7 @@ data IBCFile = IBCFile { ver :: Word8,
49 ibc_cg :: [(Name, CGInfo)],
49 ibc_cg :: [(Name, CGInfo)],
50 ibc_defs :: [(Name, Def)],
50 ibc_defs :: [(Name, Def)],
51 ibc_docstrings :: [(Name, String)],
51 ibc_docstrings :: [(Name, String)],
52+ ibc_transforms :: [(Term, Term)],
52 ibc_coercions :: [Name]
53 ibc_coercions :: [Name]
54 deriving Show
55 deriving Show
@@ -57,7 +58,7 @@ deriving instance Binary IBCFile
59initIBC :: IBCFile
60initIBC :: IBCFile
60−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
61+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
62loadIBC :: FilePath -> Idris ()
63loadIBC :: FilePath -> Idris ()
63loadIBC fp = do iLOG $ "Loading ibc " ++ fp
64loadIBC fp = do iLOG $ "Loading ibc " ++ fp
@@ -130,6 +131,7 @@ ibc i (IBCCoercion n) f = return f { ibc_coercions = n : ibc_coercions f }
130ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
131ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
131ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
132ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
132ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
133ibc 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 }
134process :: IBCFile -> FilePath -> Idris ()
136process :: IBCFile -> FilePath -> Idris ()
135process i fn
137process i fn
@@ -162,6 +164,7 @@ process i fn
162 pCG (ibc_cg i)
164 pCG (ibc_cg i)
163 pDocs (ibc_docstrings i)
165 pDocs (ibc_docstrings i)
164 pCoercions (ibc_coercions i)
166 pCoercions (ibc_coercions i)
167+ pTrans (ibc_transforms i)
166timestampOlder :: FilePath -> FilePath -> IO ()
169timestampOlder :: FilePath -> FilePath -> IO ()
167timestampOlder src ibc = do srct <- getModificationTime src
170timestampOlder src ibc = do srct <- getModificationTime src
@@ -291,6 +294,9 @@ pCG ds = mapM_ (\ (n, a) -> addToCG n a) ds
291pCoercions :: [Name] -> Idris ()
294pCoercions :: [Name] -> Idris ()
292pCoercions ns = mapM_ (\ n -> addCoercion n) ns
295pCoercions ns = mapM_ (\ n -> addCoercion n) ns
297+pTrans :: [(Term, Term)] -> Idris ()
298+pTrans ts = mapM_ addTrans ts
294----- Generated by 'derive'
300----- Generated by 'derive'
296instance Binary SizeChange where
302instance Binary SizeChange where
@@ -781,7 +787,7 @@ instance Binary Totality where
781 _ -> error "Corrupted binary data for Totality"
787 _ -> error "Corrupted binary data for Totality"
783instance Binary IBCFile where
789instance 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)
785 = {-# SCC "putIBCFile" #-}
791 = {-# SCC "putIBCFile" #-}
786 do put x1
792 do put x1
@@ -807,6 +813,7 @@ instance Binary IBCFile where
811 = do x1 <- get
818 = do x1 <- get
812 if x1 == ibcVersion then
819 if x1 == ibcVersion then
@@ -833,7 +840,8 @@ instance Binary IBCFile where
833 x22 <- get
840 x22 <- get
834 x23 <- get
841 x23 <- get
835 x24 <- get
842 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)
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)
837 else return (initIBC { ver = x1 })
845 else return (initIBC { ver = x1 })
839instance Binary FnOpt where
847instance Binary FnOpt where