@@ -40,7 +40,7 @@ import System.Directory
4040import Codec.Archive.Zip
4141
4242ibcVersion :: Word16
43−ibcVersion = 125
43+ibcVersion = 126
4444
4545data IBCFile = IBCFile { ver :: Word16,
4646 sourcefile :: FilePath,
@@ -86,7 +86,8 @@ data IBCFile = IBCFile { ver :: Word16,
8686 ibc_parsedSpan :: !(Maybe FC),
8787 ibc_usage :: ![(Name, Int)],
8888 ibc_exports :: ![Name],
89− ibc_autohints :: ![(Name, Name)]
89+ ibc_autohints :: ![(Name, Name)],
90+ ibc_deprecated :: ![(Name, String)]
9091 }
9192 deriving Show
9293{-!
@@ -94,7 +95,7 @@ deriving instance Binary IBCFile
9495!-}
9596
9697initIBC :: IBCFile
97−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] []
98+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] []
9899
99100hasValidIBCVersion :: FilePath -> Idris Bool
100101hasValidIBCVersion fp = do
@@ -179,7 +180,8 @@ entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
179180 toEntry "ibc_parsedSpan" 0 . encode <$> ibc_parsedSpan i,
180181 makeEntry "ibc_usage" (ibc_usage i),
181182 makeEntry "ibc_exports" (ibc_exports i),
182− makeEntry "ibc_autohints" (ibc_autohints i)]
183+ makeEntry "ibc_autohints" (ibc_autohints i),
184+ makeEntry "ibc_deprecated" (ibc_deprecated i)]
183185
184186writeArchive :: FilePath -> IBCFile -> Idris ()
185187writeArchive fp i = do let a = L.foldl (\x y -> addEntryToArchive y x) emptyArchive (entries i)
@@ -305,6 +307,7 @@ ibc i (IBCModDocs n) f = case lookupCtxtExact n (idris_moduledocs i) of
305307ibc i (IBCUsage n) f = return f { ibc_usage = n : ibc_usage f }
306308ibc i (IBCExport n) f = return f { ibc_exports = n : ibc_exports f }
307309ibc i (IBCAutoHint n h) f = return f { ibc_autohints = (n, h) : ibc_autohints f }
310+ibc i (IBCDeprecate n r) f = return f { ibc_deprecated = (n, r) : ibc_deprecated f }
308311
309312getEntry :: (Binary b, NFData b) => b -> FilePath -> Archive -> Idris b
310313getEntry alt f a = case findEntryByPath f a of
@@ -367,6 +370,7 @@ process reexp i fn = do
367370 pUsage =<< getEntry [] "ibc_usage" i
368371 pExports =<< getEntry [] "ibc_exports" i
369372 pAutoHints =<< getEntry [] "ibc_autohints" i
373+ pDeprecate =<< getEntry [] "ibc_deprecated" i
370374
371375timestampOlder :: FilePath -> FilePath -> Idris ()
372376timestampOlder src ibc = do srct <- runIO $ getModificationTime src
@@ -394,6 +398,9 @@ pExports ns = updateIState (\i -> i { idris_exports = ns ++ idris_exports i })
394398pAutoHints :: [(Name, Name)] -> Idris ()
395399pAutoHints ns = mapM_ (\(n,h) -> addAutoHint n h) ns
396400
401+pDeprecate :: [(Name, String)] -> Idris ()
402+pDeprecate ns = mapM_ (\(n,reason) -> addDeprecated n reason) ns
403+
397404pImportDirs :: [FilePath] -> Idris ()
398405pImportDirs fs = mapM_ addImportDir fs
399406