@@ -31,7 +31,7 @@ import Codec.Compression.Zlib (compress)
31import Util.Zlib (decompressEither)
31import Util.Zlib (decompressEither)
33ibcVersion :: Word8
33ibcVersion :: Word8
34−ibcVersion = 77
34+ibcVersion = 78
36data IBCFile = IBCFile { ver :: Word8,
36data IBCFile = IBCFile { ver :: Word8,
37 sourcefile :: FilePath,
37 sourcefile :: FilePath,
@@ -57,6 +57,7 @@ data IBCFile = IBCFile { ver :: Word8,
57 ibc_total :: [(Name, Totality)],
57 ibc_total :: [(Name, Totality)],
58 ibc_totcheckfail :: [(FC, String)],
58 ibc_totcheckfail :: [(FC, String)],
59 ibc_flags :: [(Name, [FnOpt])],
59 ibc_flags :: [(Name, [FnOpt])],
60+ ibc_fninfo :: [(Name, FnInfo)],
60 ibc_cg :: [(Name, CGInfo)],
61 ibc_cg :: [(Name, CGInfo)],
61 ibc_defs :: [(Name, Def)],
62 ibc_defs :: [(Name, Def)],
62 ibc_docstrings :: [(Name, (Docstring, [(Name, Docstring)]))],
63 ibc_docstrings :: [(Name, (Docstring, [(Name, Docstring)]))],
@@ -79,7 +80,7 @@ deriving instance Binary IBCFile
81initIBC :: IBCFile
82initIBC :: IBCFile
82−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
83+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
84loadIBC :: FilePath -> Idris ()
85loadIBC :: FilePath -> Idris ()
85loadIBC fp = do imps <- getImported
86loadIBC fp = do imps <- getImported
@@ -228,6 +229,7 @@ ibc i (IBCCG n) f = case lookupCtxt n (idris_callgraph i) of
228ibc i (IBCCoercion n) f = return f { ibc_coercions = n : ibc_coercions f }
229ibc i (IBCCoercion n) f = return f { ibc_coercions = n : ibc_coercions f }
229ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
230ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
230ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
231ibc 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 }
231ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
233ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
232ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
234ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
233ibc i (IBCErrRev t) f = return f { ibc_errRev = t : ibc_errRev f }
235ibc i (IBCErrRev t) f = return f { ibc_errRev = t : ibc_errRev f }
@@ -278,6 +280,7 @@ process i fn
278 pPatdefs (ibc_patdefs i)
280 pPatdefs (ibc_patdefs i)
279 pAccess (ibc_access i)
281 pAccess (ibc_access i)
280 pFlags (ibc_flags i)
282 pFlags (ibc_flags i)
283+ pFnInfo (ibc_fninfo i)
281 pTotal (ibc_total i)
284 pTotal (ibc_total i)
282 pTotCheckErr (ibc_totcheckfail i)
285 pTotCheckErr (ibc_totcheckfail i)
283 pCG (ibc_cg i)
286 pCG (ibc_cg i)
@@ -466,6 +469,9 @@ pAccess ds = mapM_ (\ (n, a) ->
466pFlags :: [(Name, [FnOpt])] -> Idris ()
469pFlags :: [(Name, [FnOpt])] -> Idris ()
467pFlags ds = mapM_ (\ (n, a) -> setFlags n a) ds
470pFlags ds = mapM_ (\ (n, a) -> setFlags n a) ds
472+pFnInfo :: [(Name, FnInfo)] -> Idris ()
473+pFnInfo ds = mapM_ (\ (n, a) -> setFnInfo n a) ds
469pTotal :: [(Name, Totality)] -> Idris ()
475pTotal :: [(Name, Totality)] -> Idris ()
470pTotal ds = mapM_ (\ (n, a) ->
476pTotal ds = mapM_ (\ (n, a) ->
471 do i <- getIState
477 do i <- getIState
@@ -837,7 +843,7 @@ instance Binary MetaInformation where
837 return (DataMI x1)
843 return (DataMI x1)
839instance Binary IBCFile where
845instance 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)
841 = {-# SCC "putIBCFile" #-}
847 = {-# SCC "putIBCFile" #-}
842 do put x1
848 do put x1
@@ -878,6 +884,7 @@ instance Binary IBCFile where
883 = do x1 <- get
890 = do x1 <- get
@@ -920,7 +927,8 @@ instance Binary IBCFile where
920 x37 <- get
927 x37 <- get
921 x38 <- get
928 x38 <- get
922 x39 <- get
929 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)
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)
924 else return (initIBC { ver = x1 })
932 else return (initIBC { ver = x1 })
926instance Binary DataOpt where
934instance Binary DataOpt where
@@ -953,6 +961,7 @@ instance Binary FnOpt where
953 ErrorReverse -> putWord8 10
961 ErrorReverse -> putWord8 10
954 CoveringFn -> putWord8 11
962 CoveringFn -> putWord8 11
955 NoImplicit -> putWord8 12
963 NoImplicit -> putWord8 12
964+ Constructor -> putWord8 13
957 = do i <- getWord8
966 = do i <- getWord8
958 case i of
967 case i of
@@ -970,6 +979,7 @@ instance Binary FnOpt where
970 10 -> return ErrorReverse
979 10 -> return ErrorReverse
971 11 -> return CoveringFn
980 11 -> return CoveringFn
972 12 -> return NoImplicit
981 12 -> return NoImplicit
982+ 13 -> return Constructor
973 _ -> error "Corrupted binary data for FnOpt"
983 _ -> error "Corrupted binary data for FnOpt"
975instance Binary Fixity where
985instance Binary Fixity where
@@ -1829,6 +1839,13 @@ instance Binary OptInfo where
1829 x2 <- get
1839 x2 <- get
1830 return (Optimise x1 x2)
1840 return (Optimise x1 x2)
1842+instance Binary FnInfo where
1832instance Binary TypeInfo where
1849instance Binary TypeInfo where
1833 put (TI x1 x2 x3 x4 x5) = do put x1
1850 put (TI x1 x2 x3 x4 x5) = do put x1