@@ -37,7 +37,7 @@ import Codec.Compression.Zlib (compress)
3737import Util.Zlib (decompressEither)
3838
3939ibcVersion :: Word8
40−ibcVersion = 98
40+ibcVersion = 99
4141
4242data IBCFile = IBCFile { ver :: Word8,
4343 sourcefile :: FilePath,
@@ -80,7 +80,8 @@ data IBCFile = IBCFile { ver :: Word8,
8080 ibc_patdefs :: ![(Name, ([([Name], Term, Term)], [PTerm]))],
8181 ibc_postulates :: ![Name],
8282 ibc_parsedSpan :: !(Maybe FC),
83− ibc_usage :: ![(Name, Int)]
83+ ibc_usage :: ![(Name, Int)],
84+ ibc_exports :: ![Name]
8485 }
8586 deriving Show
8687{-!
@@ -88,7 +89,7 @@ deriving instance Binary IBCFile
8889!-}
8990
9091initIBC :: IBCFile
91−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing []
92+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] []
9293
9394loadIBC :: Bool -- ^ True = reexport, False = make everything private
9495 -> FilePath -> Idris ()
@@ -233,6 +234,7 @@ ibc i (IBCModDocs n) f = case lookupCtxtExact n (idris_moduledocs i) of
233234 Just v -> return f { ibc_moduledocs = (n,v) : ibc_moduledocs f }
234235 _ -> ifail "IBC write failed"
235236ibc i (IBCUsage n) f = return f { ibc_usage = n : ibc_usage f }
237+ibc i (IBCExport n) f = return f { ibc_exports = n : ibc_exports f }
236238
237239process :: Bool -- ^ Reexporting
238240 -> IBCFile -> FilePath -> Idris ()
@@ -290,6 +292,7 @@ process reexp i fn
290292 pPostulates $ force (ibc_postulates i)
291293 pParsedSpan $ force (ibc_parsedSpan i)
292294 pUsage $ force (ibc_usage i)
295+ pExports $ force (ibc_exports i)
293296
294297timestampOlder :: FilePath -> FilePath -> Idris ()
295298timestampOlder src ibc = do srct <- runIO $ getModificationTime src
@@ -311,6 +314,10 @@ pUsage :: [(Name, Int)] -> Idris ()
311314pUsage ns = do ist <- getIState
312315 putIState ist { idris_erasureUsed = ns ++ idris_erasureUsed ist }
313316
317+pExports :: [Name] -> Idris ()
318+pExports ns = do ist <- getIState
319+ putIState ist { idris_exports = ns ++ idris_exports ist }
320+
314321pImportDirs :: [FilePath] -> Idris ()
315322pImportDirs fs = mapM_ addImportDir fs
316323
@@ -927,7 +934,7 @@ instance Binary MetaInformation where
927934 _ -> error "Corrupted binary data for MetaInformation"
928935
929936instance Binary IBCFile where
930− 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 x41 x42)
937+ 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 x41 x42 x43)
931938 = {-# SCC "putIBCFile" #-}
932939 do put x1
933940 put x2
@@ -971,6 +978,7 @@ instance Binary IBCFile where
971978 put x40
972979 put x41
973980 put x42
981+ put x43
974982
975983 get
976984 = do x1 <- get
@@ -1016,7 +1024,8 @@ instance Binary IBCFile where
10161024 x40 <- get
10171025 x41 <- get
10181026 x42 <- get
1019− 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 x41 x42)
1027+ x43 <- get
1028+ 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 x41 x42 x43)
10201029 else return (initIBC { ver = x1 })
10211030
10221031instance Binary DataOpt where