@@ -40,7 +40,7 @@ import System.Directory
40import System.FilePath
40import System.FilePath
42ibcVersion :: Word16
42ibcVersion :: Word16
43−ibcVersion = 162
43+ibcVersion = 163
45-- | When IBC is being loaded - we'll load different things (and omit
45-- | When IBC is being loaded - we'll load different things (and omit
46-- different structures/definitions) depending on which phase we're in.
46-- different structures/definitions) depending on which phase we're in.
@@ -220,9 +220,6 @@ writeIBC src f
220 logIBC 2 $ "Writing IBC for: " ++ show f
220 logIBC 2 $ "Writing IBC for: " ++ show f
221 iReport 2 $ "Writing IBC for: " ++ show f
221 iReport 2 $ "Writing IBC for: " ++ show f
222 i <- getIState
222 i <- getIState
223−-- case (Data.List.map fst (idris_metavars i)) \\ primDefs of
224−-- (_:_) -> ifail "Can't write ibc when there are unsolved metavariables"
226 resetNameIdx
223 resetNameIdx
227 ibcf <- mkIBC (ibc_write i) (initIBC { sourcefile = src })
224 ibcf <- mkIBC (ibc_write i) (initIBC { sourcefile = src })
228 idrisCatch (do runIO $ createDirectoryIfMissing True (dropFileName f)
225 idrisCatch (do runIO $ createDirectoryIfMissing True (dropFileName f)
@@ -838,120 +835,18 @@ processMetaVars ar = do
839----- For Cheapskate and docstrings
836----- For Cheapskate and docstrings
841−instance Binary a => Binary (D.Docstring a) where
838+instance Binary a => Binary (D.Docstring a)
842− put (D.DocString opts lines) = do put opts ; put lines
839+instance Binary CT.Options
843− get = do opts <- get
840+instance Binary D.DocTerm
844− lines <- get
841+instance Binary a => Binary (D.Block a)
845− return (D.DocString opts lines)
842+instance Binary a => Binary (D.Inline a)
847−instance Binary CT.Options where
848− put (CT.Options x1 x2 x3 x4) = do put x1 ; put x2 ; put x3 ; put x4
853− return (CT.Options x1 x2 x3 x4)
855−instance Binary D.DocTerm where
856− put D.Unchecked = putWord8 0
857− put (D.Checked t) = putWord8 1 >> put t
858− put (D.Example t) = putWord8 2 >> put t
859− put (D.Failing e) = putWord8 3 >> put e
861− get = do i <- getWord8
863− 0 -> return D.Unchecked
864− 1 -> fmap D.Checked get
865− 2 -> fmap D.Example get
866− 3 -> fmap D.Failing get
867− _ -> error "Corrupted binary data for DocTerm"
869−instance Binary a => Binary (D.Block a) where
870− put (D.Para lines) = do putWord8 0 ; put lines
871− put (D.Header i lines) = do putWord8 1 ; put i ; put lines
872− put (D.Blockquote bs) = do putWord8 2 ; put bs
873− put (D.List b t xs) = do putWord8 3 ; put b ; put t ; put xs
874− put (D.CodeBlock attr txt src) = do putWord8 4 ; put attr ; put txt ; put src
875− put (D.HtmlBlock txt) = do putWord8 5 ; put txt
876− put D.HRule = putWord8 6
877− get = do i <- getWord8
879− 0 -> fmap D.Para get
880− 1 -> liftM2 D.Header get get
881− 2 -> fmap D.Blockquote get
882− 3 -> liftM3 D.List get get get
883− 4 -> liftM3 D.CodeBlock get get get
884− 5 -> liftM D.HtmlBlock get
886− _ -> error "Corrupted binary data for Block"
888−instance Binary a => Binary (D.Inline a) where
889− put (D.Str txt) = do putWord8 0 ; put txt
890− put D.Space = putWord8 1
891− put D.SoftBreak = putWord8 2
892− put D.LineBreak = putWord8 3
893− put (D.Emph xs) = putWord8 4 >> put xs
894− put (D.Strong xs) = putWord8 5 >> put xs
895− put (D.Code xs tm) = putWord8 6 >> put xs >> put tm
896− put (D.Link a b c) = putWord8 7 >> put a >> put b >> put c
897− put (D.Image a b c) = putWord8 8 >> put a >> put b >> put c
898− put (D.Entity a) = putWord8 9 >> put a
899− put (D.RawHtml x) = putWord8 10 >> put x
900− get = do i <- getWord8
902− 0 -> liftM D.Str get
904− 2 -> return D.SoftBreak
905− 3 -> return D.LineBreak
906− 4 -> liftM D.Emph get
907− 5 -> liftM D.Strong get
908− 6 -> liftM2 D.Code get get
909− 7 -> liftM3 D.Link get get get
910− 8 -> liftM3 D.Image get get get
911− 9 -> liftM D.Entity get
912− 10 -> liftM D.RawHtml get
913− _ -> error "Corrupted binary data for Inline"
915−instance Binary CT.ListType where
916− put (CT.Bullet c) = putWord8 0 >> put c
917− put (CT.Numbered nw i) = putWord8 1 >> put nw >> put i
918− get = do i <- getWord8
920− 0 -> liftM CT.Bullet get
921− 1 -> liftM2 CT.Numbered get get
922− _ -> error "Corrupted binary data for ListType"
924−instance Binary CT.CodeAttr where
925− put (CT.CodeAttr a b) = put a >> put b
926− get = liftM2 CT.CodeAttr get get
928−instance Binary CT.NumWrapper where
843+instance Binary CT.ListType
929− put (CT.PeriodFollowing) = putWord8 0
844+instance Binary CT.CodeAttr
930− put (CT.ParenFollowing) = putWord8 1
845+instance Binary CT.NumWrapper
931− get = do i <- getWord8
933− 0 -> return CT.PeriodFollowing
934− 1 -> return CT.ParenFollowing
935− _ -> error "Corrupted binary data for NumWrapper"
937----- Generated by 'derive'
847----- Generated by 'derive'
939−instance Binary SizeChange where
849+instance Binary SizeChange
942− Smaller -> putWord8 0
944− Bigger -> putWord8 2
945− Unknown -> putWord8 3
953− _ -> error "Corrupted binary data for SizeChange"
955instance Binary CGInfo where
850instance Binary CGInfo where
956 put (CGInfo x1 x2 x3 x4)
851 put (CGInfo x1 x2 x3 x4)
957 = do put x1
852 = do put x1
@@ -964,110 +859,11 @@ instance Binary CGInfo where
964 x3 <- get
859 x3 <- get
965 return (CGInfo x1 x2 [] x3)
860 return (CGInfo x1 x2 [] x3)
967−instance Binary CaseType where
862+instance Binary CaseType
969− Updatable -> putWord8 0
970− Shared -> putWord8 1
971− get = do i <- getWord8
973− 0 -> return Updatable
975− _ -> error "Corrupted binary data for CaseType"
977−instance Binary SC where
863+instance Binary SC
980− Case x1 x2 x3 -> do putWord8 0
984− ProjCase x1 x2 -> do putWord8 1
987− STerm x1 -> do putWord8 2
989− UnmatchedCase x1 -> do putWord8 3
991− ImpossibleCase -> do putWord8 4
998− return (Case x1 x2 x3)
1001− return (ProjCase x1 x2)
1005− return (UnmatchedCase x1)
1006− 4 -> return ImpossibleCase
1007− _ -> error "Corrupted binary data for SC"
1010−instance Binary CaseAlt where
864+instance Binary CaseAlt
1012− = {-# SCC "putCaseAlt" #-}
1014− ConCase x1 x2 x3 x4 -> do putWord8 0
1019− ConstCase x1 x2 -> do putWord8 1
1022− DefaultCase x1 -> do putWord8 2
1024− FnCase x1 x2 x3 -> do putWord8 3
1028− SucCase x1 x2 -> do putWord8 4
1038− return (ConCase x1 x2 x3 x4)
1041− return (ConstCase x1 x2)
1043− return (DefaultCase x1)
1047− return (FnCase x1 x2 x3)
1050− return (SucCase x1 x2)
1051− _ -> error "Corrupted binary data for CaseAlt"
1053−instance Binary CaseDefs where
865+instance Binary CaseDefs
1054− put (CaseDefs x1 x2)
1060− return (CaseDefs x1 x2)
1062−instance Binary CaseInfo where
866+instance Binary CaseInfo
1063− put x@(CaseInfo x1 x2 x3) = do put x1
1069− return (CaseInfo x1 x2 x3)
1071instance Binary Def where
867instance Binary Def where
1073 = {-# SCC "putDef" #-}
869 = {-# SCC "putDef" #-}
@@ -1106,219 +902,16 @@ instance Binary Def where
1106 return (CaseOp x1 x2 x3 [] [] x5)
902 return (CaseOp x1 x2 x3 [] [] x5)
1107 _ -> error "Corrupted binary data for Def"
903 _ -> error "Corrupted binary data for Def"
1109−instance Binary Accessibility where
905+instance Binary Accessibility
1112− Public -> putWord8 0
1113− Frozen -> putWord8 1
1114− Private -> putWord8 2
1115− Hidden -> putWord8 3
1121− 2 -> return Private
1123− _ -> error "Corrupted binary data for Accessibility"
1125−instance Binary PReason where
906+instance Binary PReason
1128− Other x1 -> do putWord8 0
1130− Itself -> putWord8 1
1131− NotCovering -> putWord8 2
1132− NotPositive -> putWord8 3
1133− Mutual x1 -> do putWord8 4
1135− NotProductive -> putWord8 5
1136− BelieveMe -> putWord8 6
1137− UseUndef x1 -> do putWord8 7
1139− ExternalIO -> putWord8 8
1146− 2 -> return NotCovering
1147− 3 -> return NotPositive
1150− 5 -> return NotProductive
1151− 6 -> return BelieveMe
1153− return (UseUndef x1)
1154− 8 -> return ExternalIO
1155− _ -> error "Corrupted binary data for PReason"
1157−instance Binary Totality where
907+instance Binary Totality
1160− Total x1 -> do putWord8 0
1162− Partial x1 -> do putWord8 1
1164− Unchecked -> do putWord8 2
1165− Productive -> do putWord8 3
1166− Generated -> do putWord8 4
1173− return (Partial x1)
1174− 2 -> return Unchecked
1175− 3 -> return Productive
1176− 4 -> return Generated
1177− _ -> error "Corrupted binary data for Totality"
1179−instance Binary MetaInformation where
908+instance Binary MetaInformation
1182− EmptyMI -> do putWord8 0
1183− DataMI x1 -> do putWord8 1
1185− get = do i <- getWord8
1187− 0 -> return EmptyMI
1190− _ -> error "Corrupted binary data for MetaInformation"
1192−instance Binary DataOpt where
909+instance Binary DataOpt
1194− Codata -> putWord8 0
1195− DefaultEliminator -> putWord8 1
1196− DataErrRev -> putWord8 2
1197− DefaultCaseFun -> putWord8 3
1198− get = do i <- getWord8
1201− 1 -> return DefaultEliminator
1202− 2 -> return DataErrRev
1203− 3 -> return DefaultCaseFun
1204− _ -> error "Corrupted binary data for DataOpt"
1206−instance Binary FnOpt where
910+instance Binary FnOpt
1209− Inlinable -> putWord8 0
1210− TotalFn -> putWord8 1
1211− Dictionary -> putWord8 2
1212− AssertTotal -> putWord8 3
1213− Specialise x -> do putWord8 4
1215− AllGuarded -> putWord8 5
1216− PartialFn -> putWord8 6
1217− Implicit -> putWord8 7
1218− Reflection -> putWord8 8
1219− ErrorHandler -> putWord8 9
1220− ErrorReverse -> putWord8 10
1221− CoveringFn -> putWord8 11
1222− NoImplicit -> putWord8 12
1223− Constructor -> putWord8 13
1224− CExport x1 -> do putWord8 14
1226− AutoHint -> putWord8 15
1227− PEGenerated -> putWord8 16
1228− StaticFn -> putWord8 17
1229− OverlappingDictionary -> putWord8 18
1230− ErrorReduce -> putWord8 20
1234− 0 -> return Inlinable
1235− 1 -> return TotalFn
1236− 2 -> return Dictionary
1237− 3 -> return AssertTotal
1239− return (Specialise x)
1240− 5 -> return AllGuarded
1241− 6 -> return PartialFn
1242− 7 -> return Implicit
1243− 8 -> return Reflection
1244− 9 -> return ErrorHandler
1245− 10 -> return ErrorReverse
1246− 11 -> return CoveringFn
1247− 12 -> return NoImplicit
1248− 13 -> return Constructor
1250− return $ CExport x1
1251− 15 -> return AutoHint
1252− 16 -> return PEGenerated
1253− 17 -> return StaticFn
1254− 18 -> return OverlappingDictionary
1255− 20 -> return ErrorReduce
1256− _ -> error "Corrupted binary data for FnOpt"
1258−instance Binary Fixity where
911+instance Binary Fixity
1261− Infixl x1 -> do putWord8 0
1263− Infixr x1 -> do putWord8 1
1265− InfixN x1 -> do putWord8 2
1267− PrefixN x1 -> do putWord8 3
1279− return (PrefixN x1)
1280− _ -> error "Corrupted binary data for Fixity"
1283−instance Binary FixDecl where
912+instance Binary FixDecl
1293−instance Binary ArgOpt where
913+instance Binary ArgOpt
1296− HideDisplay -> putWord8 0
1297− InaccessibleArg -> putWord8 1
1298− AlwaysShow -> putWord8 2
1299− UnknownImp -> putWord8 3
1303− 0 -> return HideDisplay
1304− 1 -> return InaccessibleArg
1305− 2 -> return AlwaysShow
1306− 3 -> return UnknownImp
1307− _ -> error "Corrupted binary data for Static"
1309−instance Binary Static where
914+instance Binary Static
1312− Static -> putWord8 0
1313− Dynamic -> putWord8 1
1318− 1 -> return Dynamic
1319− _ -> error "Corrupted binary data for Static"
1322instance Binary Plicity where
915instance Binary Plicity where
1324 = case x of
917 = case x of
@@ -1371,283 +964,12 @@ instance Binary Plicity where
1371 return (TacImp x1 x2 x3 x4)
964 return (TacImp x1 x2 x3 x4)
1372 _ -> error "Corrupted binary data for Plicity"
965 _ -> error "Corrupted binary data for Plicity"
1375−instance (Binary t) => Binary (PDecl' t) where
967+instance Binary DefaultTotality
1376− put x
968+instance Binary LanguageExt
1377− = case x of
969+instance Binary Directive
1378− PFix x1 x2 x3 -> do putWord8 0
970+instance (Binary t) => Binary (PDecl' t)
1382− PTy x1 x2 x3 x4 x5 x6 x7 x8
1392− PClauses x1 x2 x3 x4 -> do putWord8 2
1397− PData x1 x2 x3 x4 x5 x6 ->
1405− PParams x1 x2 x3 -> do putWord8 4
1409− PNamespace x1 x2 x3 -> do putWord8 5
1413− PRecord x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 ->
1427− PInterface x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12
1441− PImplementation x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 ->
1458− PDSL x1 x2 -> do putWord8 9
1461− PCAF x1 x2 x3 -> do putWord8 10
1465− PMutual x1 x2 -> do putWord8 11
1468− PPostulate x1 x2 x3 x4 x5 x6 x7 x8
1478− PSyntax x1 x2 -> do putWord8 13
1481− PDirective x1 -> error "Cannot serialize PDirective"
1482− PProvider x1 x2 x3 x4 x5 x6 ->
1490− PTransform x1 x2 x3 x4 -> do putWord8 16
1495− PRunElabDecl x1 x2 x3 -> do putWord8 17
1499− POpenInterfaces x1 x2 x3 -> do putWord8 18
1509− return (PFix x1 x2 x3)
1518− return (PTy x1 x2 x3 x4 x5 x6 x7 x8)
1523− return (PClauses x1 x2 x3 x4)
1530− return (PData x1 x2 x3 x4 x5 x6)
1534− return (PParams x1 x2 x3)
1538− return (PNamespace x1 x2 x3)
1551− return (PRecord x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12)
1564− return (PInterface x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12)
1580− return (PImplementation x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15)
1583− return (PDSL x1 x2)
1587− return (PCAF x1 x2 x3)
1590− return (PMutual x1 x2)
1599− return (PPostulate x1 x2 x3 x4 x5 x6 x7 x8)
1602− return (PSyntax x1 x2)
1603− 14 -> do error "Cannot deserialize PDirective"
1610− return (PProvider x1 x2 x3 x4 x5 x6)
1615− return (PTransform x1 x2 x3 x4)
1619− return (PRunElabDecl x1 x2 x3)
1623− return (POpenInterfaces x1 x2 x3)
1624− _ -> error "Corrupted binary data for PDecl'"
1626−instance Binary t => Binary (ProvideWhat' t) where
971+instance Binary t => Binary (ProvideWhat' t)
1627− put (ProvTerm x1 x2) = do putWord8 0
1630− put (ProvPostulate x1) = do putWord8 1
1632− get = do y <- getWord8
1636− return (ProvTerm x1 x2)
1638− return (ProvPostulate x1)
1639− _ -> error "Corrupted binary data for ProvideWhat"
1641−instance Binary Using where
972+instance Binary Using
1642− put (UImplicit x1 x2) = do putWord8 0; put x1; put x2
1643− put (UConstraint x1 x2) = do putWord8 1; put x1; put x2
1645− get = do i <- getWord8
1647− 0 -> do x1 <- get; x2 <- get; return (UImplicit x1 x2)
1648− 1 -> do x1 <- get; x2 <- get; return (UConstraint x1 x2)
1649− _ -> error "Corrupted binary data for Using"
1651instance Binary SyntaxInfo where
973instance Binary SyntaxInfo where
1652 put (Syn x1 x2 x3 x4 _ _ x5 x6 x7 _ _ x8 _ _ _)
974 put (Syn x1 x2 x3 x4 _ _ x5 x6 x7 _ _ x8 _ _ _)
1653 = do put x1
975 = do put x1
@@ -1669,711 +991,14 @@ instance Binary SyntaxInfo where
1669 x8 <- get
991 x8 <- get
1670 return (Syn x1 x2 x3 x4 [] id x5 x6 x7 Nothing 0 x8 0 True True)
992 return (Syn x1 x2 x3 x4 [] id x5 x6 x7 Nothing 0 x8 0 True True)
1672−instance (Binary t) => Binary (PClause' t) where
994+instance (Binary t) => Binary (PClause' t)
1673− put x
995+instance (Binary t) => Binary (PData' t)
1674− = case x of
996+instance Binary PunInfo
1675− PClause x1 x2 x3 x4 x5 x6 -> do putWord8 0
997+instance Binary PTerm
1676− put x1
998+instance Binary PAltType
1677− put x2
999+instance (Binary t) => Binary (PTactic' t)
1678− put x3
1000+instance (Binary t) => Binary (PDo' t)
1679− put x4
1001+instance (Binary t) => Binary (PArg' t)
1682− PWith x1 x2 x3 x4 x5 x6 x7 -> do putWord8 1
1690− PClauseR x1 x2 x3 x4 -> do putWord8 2
1695− PWithR x1 x2 x3 x4 x5 -> do putWord8 3
1710− return (PClause x1 x2 x3 x4 x5 x6)
1718− return (PWith x1 x2 x3 x4 x5 x6 x7)
1723− return (PClauseR x1 x2 x3 x4)
1729− return (PWithR x1 x2 x3 x4 x5)
1730− _ -> error "Corrupted binary data for PClause'"
1732−instance (Binary t) => Binary (PData' t) where
1735− PDatadecl x1 x2 x3 x4 -> do putWord8 0
1740− PLaterdecl x1 x2 x3 -> do putWord8 1
1751− return (PDatadecl x1 x2 x3 x4)
1755− return (PLaterdecl x1 x2 x3)
1756− _ -> error "Corrupted binary data for PData'"
1758−instance Binary PunInfo where
1761− TypeOrTerm -> putWord8 0
1762− IsType -> putWord8 1
1763− IsTerm -> putWord8 2
1767− 0 -> return TypeOrTerm
1770− _ -> error "Corrupted binary data for PunInfo"
1772−instance Binary PTerm where
1775− PQuote x1 -> do putWord8 0
1777− PRef x1 x2 x3 -> do putWord8 1
1781− PInferRef x1 x2 x3 -> do putWord8 2
1785− PPatvar x1 x2 -> do putWord8 3
1788− PLam x1 x2 x3 x4 x5 -> do putWord8 4
1794− PPi x1 x2 x3 x4 x5 -> do putWord8 5
1800− PLet x1 x2 x3 x4 x5 x6 -> do putWord8 6
1807− PTyped x1 x2 -> do putWord8 7
1810− PAppImpl x1 x2 -> error "PAppImpl in final term"
1811− PApp x1 x2 x3 -> do putWord8 8
1815− PAppBind x1 x2 x3 -> do putWord8 9
1819− PMatchApp x1 x2 -> do putWord8 10
1822− PCase x1 x2 x3 -> do putWord8 11
1826− PTrue x1 x2 -> do putWord8 12
1829− PResolveTC x1 -> do putWord8 15
1831− PRewrite x1 x2 x3 x4 x5 -> do putWord8 17
1837− PPair x1 x2 x3 x4 x5 -> do putWord8 18
1843− PDPair x1 x2 x3 x4 x5 x6 -> do putWord8 19
1850− PAlternative x1 x2 x3 -> do putWord8 20
1854− PHidden x1 -> do putWord8 21
1856− PType x1 -> do putWord8 22
1858− PGoal x1 x2 x3 x4 -> do putWord8 23
1863− PConstant x1 x2 -> do putWord8 24
1866− Placeholder -> putWord8 25
1867− PDoBlock x1 -> do putWord8 26
1869− PIdiom x1 x2 -> do putWord8 27
1872− PMetavar x1 x2 -> do putWord8 29
1875− PProof x1 -> do putWord8 30
1877− PTactics x1 -> do putWord8 31
1879− PImpossible -> putWord8 33
1880− PCoerced x1 -> do putWord8 34
1882− PUnifyLog x1 -> do putWord8 35
1884− PNoImplicits x1 -> do putWord8 36
1886− PDisamb x1 x2 -> do putWord8 37
1889− PUniverse x1 x2 -> do putWord8 38
1892− PRunElab x1 x2 x3 -> do putWord8 39
1896− PAs x1 x2 x3 -> do putWord8 40
1900− PElabError x1 -> do putWord8 41
1902− PQuasiquote x1 x2 -> do putWord8 42
1905− PUnquote x1 -> do putWord8 43
1907− PQuoteName x1 x2 x3 -> do putWord8 44
1911− PIfThenElse x1 x2 x3 x4 -> do putWord8 45
1916− PConstSugar x1 x2 -> do putWord8 46
1919− PWithApp x1 x2 x3 -> do putWord8 47
1932− return (PRef x1 x2 x3)
1936− return (PInferRef x1 x2 x3)
1939− return (PPatvar x1 x2)
1945− return (PLam x1 x2 x3 x4 x5)
1951− return (PPi x1 x2 x3 x4 x5)
1958− return (PLet x1 x2 x3 x4 x5 x6)
1961− return (PTyped x1 x2)
1965− return (PApp x1 x2 x3)
1969− return (PAppBind x1 x2 x3)
1972− return (PMatchApp x1 x2)
1976− return (PCase x1 x2 x3)
1979− return (PTrue x1 x2)
1981− return (PResolveTC x1)
1987− return (PRewrite x1 x2 x3 x4 x5)
1993− return (PPair x1 x2 x3 x4 x5)
2000− return (PDPair x1 x2 x3 x4 x5 x6)
2004− return (PAlternative x1 x2 x3)
2006− return (PHidden x1)
2013− return (PGoal x1 x2 x3 x4)
2016− return (PConstant x1 x2)
2017− 25 -> return Placeholder
2019− return (PDoBlock x1)
2022− return (PIdiom x1 x2)
2025− return (PMetavar x1 x2)
2029− return (PTactics x1)
2030− 33 -> return PImpossible
2032− return (PCoerced x1)
2034− return (PUnifyLog x1)
2036− return (PNoImplicits x1)
2039− return (PDisamb x1 x2)
2042− return (PUniverse x1 x2)
2046− return (PRunElab x1 x2 x3)
2050− return (PAs x1 x2 x3)
2052− return (PElabError x1)
2055− return (PQuasiquote x1 x2)
2057− return (PUnquote x1)
2061− return (PQuoteName x1 x2 x3)
2066− return (PIfThenElse x1 x2 x3 x4)
2069− return (PConstSugar x1 x2)
2073− return (PWithApp x1 x2 x3)
2074− _ -> error "Corrupted binary data for PTerm"
2076−instance Binary PAltType where
2079− ExactlyOne x1 -> do putWord8 0
2081− FirstSuccess -> putWord8 1
2082− TryImplicit -> putWord8 2
2087− return (ExactlyOne x1)
2088− 1 -> return FirstSuccess
2089− 2 -> return TryImplicit
2090− _ -> error "Corrupted binary data for PAltType"
2093−instance (Binary t) => Binary (PTactic' t) where
2096− Intro x1 -> do putWord8 0
2098− Focus x1 -> do putWord8 1
2100− Refine x1 x2 -> do putWord8 2
2103− Rewrite x1 -> do putWord8 3
2105− LetTac x1 x2 -> do putWord8 4
2108− Exact x1 -> do putWord8 5
2110− Compute -> putWord8 6
2111− Trivial -> putWord8 7
2112− Solve -> putWord8 8
2113− Attack -> putWord8 9
2114− ProofState -> putWord8 10
2115− ProofTerm -> putWord8 11
2116− Undo -> putWord8 12
2117− Try x1 x2 -> do putWord8 13
2120− TSeq x1 x2 -> do putWord8 14
2124− ApplyTactic x1 -> do putWord8 16
2126− Reflect x1 -> do putWord8 17
2128− Fill x1 -> do putWord8 18
2130− Induction x1 -> do putWord8 19
2132− ByReflection x1 -> do putWord8 20
2134− ProofSearch x1 x2 x3 x4 x5 x6 -> do putWord8 21
2141− DoUnify -> putWord8 22
2142− CaseTac x1 -> do putWord8 23
2144− SourceFC -> putWord8 24
2145− Intros -> putWord8 25
2146− Equiv x1 -> do putWord8 26
2148− Claim x1 x2 -> do putWord8 27
2151− Unfocus -> putWord8 28
2152− MatchRefine x1 -> do putWord8 29
2154− LetTacTy x1 x2 x3 -> do putWord8 30
2158− TCImplementation -> putWord8 31
2159− GoalType x1 x2 -> do putWord8 32
2162− TCheck x1 -> do putWord8 33
2164− TEval x1 -> do putWord8 34
2166− TDocStr x1 -> do putWord8 35
2168− TSearch x1 -> do putWord8 36
2170− Skip -> putWord8 37
2171− TFail x1 -> do putWord8 38
2173− Abandon -> putWord8 39
2183− return (Refine x1 x2)
2185− return (Rewrite x1)
2188− return (LetTac x1 x2)
2191− 6 -> return Compute
2192− 7 -> return Trivial
2195− 10 -> return ProofState
2196− 11 -> return ProofTerm
2203− return (TSeq x1 x2)
2206− return (ApplyTactic x1)
2208− return (Reflect x1)
2212− return (Induction x1)
2214− return (ByReflection x1)
2221− return (ProofSearch x1 x2 x3 x4 x5 x6)
2222− 22 -> return DoUnify
2224− return (CaseTac x1)
2225− 24 -> return SourceFC
2226− 25 -> return Intros
2231− return (Claim x1 x2)
2232− 28 -> return Unfocus
2234− return (MatchRefine x1)
2238− return (LetTacTy x1 x2 x3)
2239− 31 -> return TCImplementation
2242− return (GoalType x1 x2)
2248− return (TDocStr x1)
2250− return (TSearch x1)
2254− 39 -> return Abandon
2255− _ -> error "Corrupted binary data for PTactic'"
2258−instance (Binary t) => Binary (PDo' t) where
2261− DoExp x1 x2 -> do putWord8 0
2264− DoBind x1 x2 x3 x4 -> do putWord8 1
2269− DoBindP x1 x2 x3 x4 -> do putWord8 2
2274− DoLet x1 x2 x3 x4 x5 -> do putWord8 3
2280− DoLetP x1 x2 x3 -> do putWord8 4
2284− DoRewrite x1 x2 -> do putWord8 5
2292− return (DoExp x1 x2)
2297− return (DoBind x1 x2 x3 x4)
2302− return (DoBindP x1 x2 x3 x4)
2308− return (DoLet x1 x2 x3 x4 x5)
2312− return (DoLetP x1 x2 x3)
2316− return (DoRewrite x1 x2)
2317− _ -> error "Corrupted binary data for PDo'"
2320−instance (Binary t) => Binary (PArg' t) where
2323− PImp x1 x2 x3 x4 x5 ->
2330− PExp x1 x2 x3 x4 ->
2336− PConstraint x1 x2 x3 x4 ->
2342− PTacImplicit x1 x2 x3 x4 x5 ->
2357− return (PImp x1 x2 x3 x4 x5)
2362− return (PExp x1 x2 x3 x4)
2367− return (PConstraint x1 x2 x3 x4)
2373− return (PTacImplicit x1 x2 x3 x4 x5)
2374− _ -> error "Corrupted binary data for PArg'"
2377instance Binary InterfaceInfo where
1002instance Binary InterfaceInfo where
2378 put (CI x1 x2 x3 x4 x5 x6 x7 _ x8)
1003 put (CI x1 x2 x3 x4 x5 x6 x7 _ x8)
2379 = do put x1
1004 = do put x1
@@ -2395,160 +1020,13 @@ instance Binary InterfaceInfo where
2395 x8 <- get
1020 x8 <- get
2396 return (CI x1 x2 x3 x4 x5 x6 x7 [] x8)
1021 return (CI x1 x2 x3 x4 x5 x6 x7 [] x8)
2398−instance Binary RecordInfo where
1023+instance Binary RecordInfo
2407− return (RI x1 x2 x3)
2409−instance Binary OptInfo where
1024+instance Binary OptInfo
2410− put (Optimise x1 x2 x3)
2418− return (Optimise x1 x2 x3)
2420−instance Binary FnInfo where
1025+instance Binary FnInfo
2427−instance Binary TypeInfo where
1026+instance Binary TypeInfo
2428− put (TI x1 x2 x3 x4 x5 x6) = do put x1
2440− return (TI x1 x2 x3 x4 x5 x6)
2442−instance Binary SynContext where
1027+instance Binary SynContext
2445− PatternSyntax -> putWord8 0
2446− TermSyntax -> putWord8 1
2447− AnySyntax -> putWord8 2
2451− 0 -> return PatternSyntax
2452− 1 -> return TermSyntax
2453− 2 -> return AnySyntax
2454− _ -> error "Corrupted binary data for SynContext"
2457−instance Binary Syntax where
1028+instance Binary Syntax
2458− put (Rule x1 x2 x3)
2463− put (DeclRule x1 x2)
2473− return (Rule x1 x2 x3)
2476− return (DeclRule x1 x2)
2477− _ -> error "Corrupted binary data for Syntax"
2479−instance (Binary t) => Binary (DSL' t) where
1029+instance (Binary t) => Binary (DSL' t)
2480− put (DSL x1 x2 x3 x4 x5 x6 x7 x8 x9)
2500− return (DSL x1 x2 x3 x4 x5 x6 x7 x8 x9)
2502−instance Binary SSymbol where
1030+instance Binary SSymbol
2505− Keyword x1 -> do putWord8 0
2507− Symbol x1 -> do putWord8 1
2509− Expr x1 -> do putWord8 2
2511− SimpleExpr x1 -> do putWord8 3
2513− Binding x1 -> do putWord8 4
2519− return (Keyword x1)
2525− return (SimpleExpr x1)
2527− return (Binding x1)
2528− _ -> error "Corrupted binary data for SSymbol"
2530−instance Binary Codegen where
1031+instance Binary Codegen
2533− Via ir str -> do putWord8 0
2536− Bytecode -> putWord8 1
2543− 1 -> return Bytecode
2544− _ -> error "Corrupted binary data for Codegen"
2546−instance Binary IRFormat where
1032+instance Binary IRFormat
2548− IBCFormat -> putWord8 0
2549− JSONFormat -> putWord8 1
2550− get = do i <- getWord8
2552− 0 -> return IBCFormat
2553− 1 -> return JSONFormat
2554− _ -> error "Corrupted binary data for IRFormat"