@@ -31,7 +31,7 @@ import Codec.Compression.Zlib (compress)
3131import Util.Zlib (decompressEither)
3232
3333ibcVersion :: Word8
34−ibcVersion = 77
34+ibcVersion = 78
3535
3636data IBCFile = IBCFile { ver :: Word8,
3737 sourcefile :: FilePath,
@@ -57,6 +57,7 @@ data IBCFile = IBCFile { ver :: Word8,
5757 ibc_total :: [(Name, Totality)],
5858 ibc_totcheckfail :: [(FC, String)],
5959 ibc_flags :: [(Name, [FnOpt])],
60+ ibc_fninfo :: [(Name, FnInfo)],
6061 ibc_cg :: [(Name, CGInfo)],
6162 ibc_defs :: [(Name, Def)],
6263 ibc_docstrings :: [(Name, (Docstring, [(Name, Docstring)]))],
@@ -79,7 +80,7 @@ deriving instance Binary IBCFile
7980!-}
8081
8182initIBC :: IBCFile
82−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
83+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
8384
8485loadIBC :: FilePath -> Idris ()
8586loadIBC fp = do imps <- getImported
@@ -228,6 +229,7 @@ ibc i (IBCCG n) f = case lookupCtxt n (idris_callgraph i) of
228229ibc i (IBCCoercion n) f = return f { ibc_coercions = n : ibc_coercions f }
229230ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
230231ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
232+ibc i (IBCFnInfo n a) f = return f { ibc_fninfo = (n,a) : ibc_fninfo f }
231233ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
232234ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
233235ibc i (IBCErrRev t) f = return f { ibc_errRev = t : ibc_errRev f }
@@ -278,6 +280,7 @@ process i fn
278280 pPatdefs (ibc_patdefs i)
279281 pAccess (ibc_access i)
280282 pFlags (ibc_flags i)
283+ pFnInfo (ibc_fninfo i)
281284 pTotal (ibc_total i)
282285 pTotCheckErr (ibc_totcheckfail i)
283286 pCG (ibc_cg i)
@@ -466,6 +469,9 @@ pAccess ds = mapM_ (\ (n, a) ->
466469pFlags :: [(Name, [FnOpt])] -> Idris ()
467470pFlags ds = mapM_ (\ (n, a) -> setFlags n a) ds
468471
472+pFnInfo :: [(Name, FnInfo)] -> Idris ()
473+pFnInfo ds = mapM_ (\ (n, a) -> setFnInfo n a) ds
474+
469475pTotal :: [(Name, Totality)] -> Idris ()
470476pTotal ds = mapM_ (\ (n, a) ->
471477 do i <- getIState
@@ -837,7 +843,7 @@ instance Binary MetaInformation where
837843 return (DataMI x1)
838844
839845instance Binary IBCFile where
840− 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 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39)
846+ 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 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40)
841847 = {-# SCC "putIBCFile" #-}
842848 do put x1
843849 put x2
@@ -878,6 +884,7 @@ instance Binary IBCFile where
878884 put x37
879885 put x38
880886 put x39
887+ put x40
881888
882889 get
883890 = do x1 <- get
@@ -920,7 +927,8 @@ instance Binary IBCFile where
920927 x37 <- get
921928 x38 <- get
922929 x39 <- get
923− 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 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39)
930+ x40 <- get
931+ 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 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40)
924932 else return (initIBC { ver = x1 })
925933
926934instance Binary DataOpt where
@@ -953,6 +961,7 @@ instance Binary FnOpt where
953961 ErrorReverse -> putWord8 10
954962 CoveringFn -> putWord8 11
955963 NoImplicit -> putWord8 12
964+ Constructor -> putWord8 13
956965 get
957966 = do i <- getWord8
958967 case i of
@@ -970,6 +979,7 @@ instance Binary FnOpt where
970979 10 -> return ErrorReverse
971980 11 -> return CoveringFn
972981 12 -> return NoImplicit
982+ 13 -> return Constructor
973983 _ -> error "Corrupted binary data for FnOpt"
974984
975985instance Binary Fixity where
@@ -1829,6 +1839,13 @@ instance Binary OptInfo where
18291839 x2 <- get
18301840 return (Optimise x1 x2)
18311841
1842+instance Binary FnInfo where
1843+ put (FnInfo x1)
1844+ = put x1
1845+ get
1846+ = do x1 <- get
1847+ return (FnInfo x1)
1848+
18321849instance Binary TypeInfo where
18331850 put (TI x1 x2 x3 x4 x5) = do put x1
18341851 put x2