on master help sign in
Check linearity of functions

We can only use a linear function name in a type if it's bound with multiplicity 1. Any function which might return something linear is itself considered necessarily linear.

commit89dd6aef56fcecf761232f32aed6bfac4b599a5c authorEdwin Brady <ecb10@st-andrews.ac.uk> dateTue 20 Dec 2016, 14:30 (10 years ago) parent1a1176d
11 files changed+102−57
CHANGELOG.md+10−2 src/IRTS/Compiler.hs+1−1 src/Idris/ASTUtils.hs+1−1 src/Idris/Core/Evaluate.hs+50−32 src/Idris/Core/Typecheck.hs+3−3 src/Idris/Elab/Clause.hs+11 src/Idris/Elab/Data.hs+3−4 src/Idris/Elab/Type.hs+5−4 src/Idris/Elab/Utils.hs+15−7 src/Idris/IBC.hs+1−1 src/Idris/TypeSearch.hs+2−2
CHANGELOG.md+10−2
@@ -2,14 +2,22 @@
22
33## Language updates
44
5−* New language extensions, in addition to the existing `TypeProviders` and
6− `ErrorReflection`:
5+* Language pragmas now required for the less stable existing features, in
6+ addition to the existing `TypeProviders` and `ErrorReflection`:
77 + `ElabReflection`, which must be enabled to use `%runElab`
88 + `UniquenessTypes`, which must be enabled to use `UniqueType`
99 + `DSLNotation`, which must be enabled to define a `dsl` block
1010 + `FirstClassReflection`, which must be enabled to define a `%reflection`
1111 function
1212
13+* New language extension `LinearTypes`:
14+ + This allows adding a /multiplicity/ to a binder which says how often it
15+ is allowed to be used; either 0 or 1 (if unstated, multiplicity is "many")
16+ + The typing rules follow Conor McBride's paper "I Got Plenty o' Nuttin'"
17+ + This is highly experimental, unfinished, not at all polished. and there
18+ are still lots of details to sort out. Some features don't quite work
19+ properly yet. But it is there to play with for the brave!
20+
1321## Tool Updates
1422
1523+ Idris' output has been updated to more accurately reflect its
src/IRTS/Compiler.hs+1−1
@@ -466,7 +466,7 @@ irTerm top vs env tm@(App _ f a) = do
466466 | otherwise = n
467467
468468 used = maybe [] (map fst . usedpos) $ lookupCtxtExact uName (idris_callgraph ist)
469− fst4 (x,_,_,_,_) = x
469+ fst4 (x,_,_,_,_,_) = x
470470
471471irTerm top vs env (P _ n _) = return $ LV (Glob n)
472472irTerm top vs env (V i)
src/Idris/ASTUtils.hs+1−1
@@ -148,7 +148,7 @@ opts_idrisCmdline =
148148--
149149-- This has a terrible name, but I'm not sure of a better one that
150150-- isn't confusingly close to tt_ctxt
151−known_terms :: Field IState (Ctxt (Def, Injectivity, Accessibility, Totality, MetaInformation))
151+known_terms :: Field IState (Ctxt (Def, RigCount, Injectivity, Accessibility, Totality, MetaInformation))
152152known_terms = Field (definitions . tt_ctxt)
153153 (\v state -> state {tt_ctxt = (tt_ctxt state) {definitions = v}})
154154
src/Idris/Core/Evaluate.hs+50−32
@@ -16,12 +16,14 @@ module Idris.Core.Evaluate(normalise, normaliseTrace, normaliseC,
1616 Def(..), CaseInfo(..), CaseDefs(..),
1717 Accessibility(..), Injectivity, Totality(..), PReason(..), MetaInformation(..),
1818 Context, initContext, ctxtAlist, next_tvar,
19− addToCtxt, setAccess, setInjective, setTotal, setMetaInformation, addCtxtDef, addTyDecl,
19+ addToCtxt, setAccess, setInjective, setTotal, setRigCount,
20+ setMetaInformation, addCtxtDef, addTyDecl,
2021 addDatatype, addCasedef, simplifyCasedef, addOperator,
2122 lookupNames, lookupTyName, lookupTyNameExact, lookupTy, lookupTyExact,
2223 lookupP, lookupP_all, lookupDef, lookupNameDef, lookupDefExact, lookupDefAcc, lookupDefAccExact, lookupVal,
2324 mapDefCtxt, tcReducible,
2425 lookupTotal, lookupTotalExact, lookupInjectiveExact,
26+ lookupRigCount, lookupRigCountExact,
2527 lookupNameTotal, lookupMetaInformation, lookupTyEnv, isTCDict,
2628 isCanonical, isDConName, canBeDConName, isTConName, isConName, isFnName,
2729 Value(..), Quote(..), initEval, uniqueNameCtxt, uniqueBindersCtxt, definitions,
@@ -866,9 +868,11 @@ data MetaInformation =
866868
867869-- | Contexts used for global definitions and for proof state. They contain
868870-- universe constraints and existing definitions.
871+-- Also store maximum RigCount of the name (can't bind a name at multiplicity
872+-- 1 in a RigW, for example)
869873data Context = MkContext {
870874 next_tvar :: Int,
871− definitions :: Ctxt (Def, Injectivity, Accessibility, Totality, MetaInformation)
875+ definitions :: Ctxt (Def, RigCount, Injectivity, Accessibility, Totality, MetaInformation)
872876 } deriving (Show, Generic)
873877
874878
@@ -878,53 +882,59 @@ initContext = MkContext 0 emptyContext
878882
879883mapDefCtxt :: (Def -> Def) -> Context -> Context
880884mapDefCtxt f (MkContext t !defs) = MkContext t (mapCtxt f' defs)
881− where f' (!d, i, a, t, m) = f' (f d, i, a, t, m)
885+ where f' (!d, r, i, a, t, m) = f' (f d, r, i, a, t, m)
882886
883887-- | Get the definitions from a context
884888ctxtAlist :: Context -> [(Name, Def)]
885−ctxtAlist ctxt = map (\(n, (d, i, a, t, m)) -> (n, d)) $ toAlist (definitions ctxt)
889+ctxtAlist ctxt = map (\(n, (d, r, i, a, t, m)) -> (n, d)) $ toAlist (definitions ctxt)
886890
887891veval ctxt env t = evalState (eval False ctxt [] env t []) initEval
888892
889893addToCtxt :: Name -> Term -> Type -> Context -> Context
890894addToCtxt n tm ty uctxt
891895 = let ctxt = definitions uctxt
892− !ctxt' = addDef n (Function ty tm, False, Public, Unchecked, EmptyMI) ctxt in
896+ !ctxt' = addDef n (Function ty tm, RigW, False, Public, Unchecked, EmptyMI) ctxt in
893897 uctxt { definitions = ctxt' }
894898
895899setAccess :: Name -> Accessibility -> Context -> Context
896900setAccess n a uctxt
897901 = let ctxt = definitions uctxt
898− !ctxt' = updateDef n (\ (d, i, _, t, m) -> (d, i, a, t, m)) ctxt in
902+ !ctxt' = updateDef n (\ (d, r, i, _, t, m) -> (d, r, i, a, t, m)) ctxt in
899903 uctxt { definitions = ctxt' }
900904
901905setInjective :: Name -> Injectivity -> Context -> Context
902906setInjective n i uctxt
903907 = let ctxt = definitions uctxt
904− !ctxt' = updateDef n (\ (d, _, a, t, m) -> (d, i, a, t, m)) ctxt in
908+ !ctxt' = updateDef n (\ (d, r, _, a, t, m) -> (d, r, i, a, t, m)) ctxt in
905909 uctxt { definitions = ctxt' }
906910
907911setTotal :: Name -> Totality -> Context -> Context
908912setTotal n t uctxt
909913 = let ctxt = definitions uctxt
910− !ctxt' = updateDef n (\ (d, i, a, _, m) -> (d, i, a, t, m)) ctxt in
914+ !ctxt' = updateDef n (\ (d, r, i, a, _, m) -> (d, r, i, a, t, m)) ctxt in
915+ uctxt { definitions = ctxt' }
916+
917+setRigCount :: Name -> RigCount -> Context -> Context
918+setRigCount n rc uctxt
919+ = let ctxt = definitions uctxt
920+ !ctxt' = updateDef n (\ (d, _, i, a, t, m) -> (d, rc, i, a, t, m)) ctxt in
911921 uctxt { definitions = ctxt' }
912922
913923setMetaInformation :: Name -> MetaInformation -> Context -> Context
914924setMetaInformation n m uctxt
915925 = let ctxt = definitions uctxt
916− !ctxt' = updateDef n (\ (d, i, a, t, _) -> (d, i, a, t, m)) ctxt in
926+ !ctxt' = updateDef n (\ (d, r, i, a, t, _) -> (d, r, i, a, t, m)) ctxt in
917927 uctxt { definitions = ctxt' }
918928
919929addCtxtDef :: Name -> Def -> Context -> Context
920930addCtxtDef n d c = let ctxt = definitions c
921− !ctxt' = addDef n (d, False, Public, Unchecked, EmptyMI) $! ctxt in
931+ !ctxt' = addDef n (d, RigW, False, Public, Unchecked, EmptyMI) $! ctxt in
922932 c { definitions = ctxt' }
923933
924934addTyDecl :: Name -> NameType -> Type -> Context -> Context
925935addTyDecl n nt ty uctxt
926936 = let ctxt = definitions uctxt
927− !ctxt' = addDef n (TyDecl nt ty, False, Public, Unchecked, EmptyMI) ctxt in
937+ !ctxt' = addDef n (TyDecl nt ty, RigW, False, Public, Unchecked, EmptyMI) ctxt in
928938 uctxt { definitions = ctxt' }
929939
930940addDatatype :: Datatype Name -> Context -> Context
@@ -932,14 +942,14 @@ addDatatype (Data n tag ty unique cons) uctxt
932942 = let ctxt = definitions uctxt
933943 ty' = normalise uctxt [] ty
934944 !ctxt' = addCons 0 cons (addDef n
935− (TyDecl (TCon tag (arity ty')) ty, True, Public, Unchecked, EmptyMI) ctxt) in
945+ (TyDecl (TCon tag (arity ty')) ty, RigW, True, Public, Unchecked, EmptyMI) ctxt) in
936946 uctxt { definitions = ctxt' }
937947 where
938948 addCons tag [] ctxt = ctxt
939949 addCons tag ((n, ty) : cons) ctxt
940950 = let ty' = normalise uctxt [] ty in
941951 addCons (tag+1) cons (addDef n
942− (TyDecl (DCon tag (arity ty') unique) ty, True, Public, Unchecked, EmptyMI) ctxt)
952+ (TyDecl (DCon tag (arity ty') unique) ty, RigW, True, Public, Unchecked, EmptyMI) ctxt)
943953
944954-- FIXME: Too many arguments! Refactor all these Bools.
945955--
@@ -973,7 +983,7 @@ addCasedef n ei ci@(CaseInfo inline alwaysInline tcdict)
973983 (args_rt, sc_rt)
974984 op = (CaseOp (ci { case_inlinable = inlc })
975985 ty argtys ps_in ps_ct cdef,
976− False, access, Unchecked, EmptyMI)
986+ RigW, False, access, Unchecked, EmptyMI)
977987 in return $ addDef n op ctxt
978988-- other -> tfail (Msg $ "Error adding case def: " ++ show other)
979989 return uctxt { definitions = ctxt' }
@@ -986,15 +996,15 @@ simplifyCasedef :: Name -> ErasureInfo -> Context -> TC Context
986996simplifyCasedef n ei uctxt
987997 = do let ctxt = definitions uctxt
988998 ctxt' <- case lookupCtxt n ctxt of
989− [(CaseOp ci ty atys [] ps _, inj, acc, tot, metainf)] ->
999+ [(CaseOp ci ty atys [] ps _, rc, inj, acc, tot, metainf)] ->
9901000 return ctxt -- nothing to simplify (or already done...)
991− [(CaseOp ci ty atys ps_in ps cd, inj, acc, tot, metainf)] ->
1001+ [(CaseOp ci ty atys ps_in ps cd, rc, inj, acc, tot, metainf)] ->
9921002 do let ps_in' = map simpl ps_in
9931003 pdef = map debind ps_in'
9941004 CaseDef args sc _ <- simpleCase False (STerm Erased) False CompileTime emptyFC [] atys pdef ei
9951005 return $ addDef n (CaseOp ci
9961006 ty atys ps_in' ps (cd { cases_compiletime = (args, sc) }),
997− inj, acc, tot, metainf) ctxt
1007+ rc, inj, acc, tot, metainf) ctxt
9981008
9991009 _ -> return ctxt
10001010 return uctxt { definitions = ctxt' }
@@ -1014,10 +1024,10 @@ addOperator :: Name -> Type -> Int -> ([Value] -> Maybe Value) ->
10141024 Context -> Context
10151025addOperator n ty a op uctxt
10161026 = let ctxt = definitions uctxt
1017− ctxt' = addDef n (Operator ty a op, False, Public, Unchecked, EmptyMI) ctxt in
1027+ ctxt' = addDef n (Operator ty a op, RigW, False, Public, Unchecked, EmptyMI) ctxt in
10181028 uctxt { definitions = ctxt' }
10191029
1020−tfst (a, _, _, _, _) = a
1030+tfst (a, _, _, _, _, _) = a
10211031
10221032lookupNames :: Name -> Context -> [Name]
10231033lookupNames n ctxt
@@ -1103,10 +1113,10 @@ lookupP_all :: Bool -> Bool -> Name -> Context -> [Term]
11031113lookupP_all all exact n ctxt
11041114 = do (n', def) <- names
11051115 p <- case def of
1106− (Function ty tm, inj, a, _, _) -> return (P Ref n' ty, a)
1107− (TyDecl nt ty, _, a, _, _) -> return (P nt n' ty, a)
1108− (CaseOp _ ty _ _ _ _, inj, a, _, _) -> return (P Ref n' ty, a)
1109− (Operator ty _ _, inj, a, _, _) -> return (P Ref n' ty, a)
1116+ (Function ty tm, _, inj, a, _, _) -> return (P Ref n' ty, a)
1117+ (TyDecl nt ty, _, _, a, _, _) -> return (P nt n' ty, a)
1118+ (CaseOp _ ty _ _ _ _, _, inj, a, _, _) -> return (P Ref n' ty, a)
1119+ (Operator ty _ _, _, inj, a, _, _) -> return (P Ref n' ty, a)
11101120 case snd p of
11111121 Hidden -> if all then return (fst p) else []
11121122 Private -> if all then return (fst p) else []
@@ -1133,28 +1143,36 @@ lookupDefAcc :: Name -> Bool -> Context ->
11331143lookupDefAcc n mkpublic ctxt
11341144 = map mkp $ lookupCtxt n (definitions ctxt)
11351145 -- io_bind a special case for REPL prettiness
1136− where mkp (d, inj, a, _, _) = if mkpublic && (not (n == sUN "io_bind" || n == sUN "io_pure"))
1137− then (d, Public) else (d, a)
1146+ where mkp (d, _, inj, a, _, _) = if mkpublic && (not (n == sUN "io_bind" || n == sUN "io_pure"))
1147+ then (d, Public) else (d, a)
11381148
11391149lookupDefAccExact :: Name -> Bool -> Context ->
11401150 Maybe (Def, Accessibility)
11411151lookupDefAccExact n mkpublic ctxt
11421152 = fmap mkp $ lookupCtxtExact n (definitions ctxt)
11431153 -- io_bind a special case for REPL prettiness
1144− where mkp (d, inj, a, _, _) = if mkpublic && (not (n == sUN "io_bind" || n == sUN "io_pure"))
1145− then (d, Public) else (d, a)
1154+ where mkp (d, _, inj, a, _, _) = if mkpublic && (not (n == sUN "io_bind" || n == sUN "io_pure"))
1155+ then (d, Public) else (d, a)
11461156
11471157lookupTotal :: Name -> Context -> [Totality]
11481158lookupTotal n ctxt = map mkt $ lookupCtxt n (definitions ctxt)
1149− where mkt (d, inj, a, t, m) = t
1159+ where mkt (d, _, inj, a, t, m) = t
11501160
11511161lookupTotalExact :: Name -> Context -> Maybe Totality
11521162lookupTotalExact n ctxt = fmap mkt $ lookupCtxtExact n (definitions ctxt)
1153− where mkt (d, inj, a, t, m) = t
1163+ where mkt (d, _, inj, a, t, m) = t
1164+
1165+lookupRigCount :: Name -> Context -> [Totality]
1166+lookupRigCount n ctxt = map mkt $ lookupCtxt n (definitions ctxt)
1167+ where mkt (d, _, inj, a, t, m) = t
1168+
1169+lookupRigCountExact :: Name -> Context -> Maybe RigCount
1170+lookupRigCountExact n ctxt = fmap mkt $ lookupCtxtExact n (definitions ctxt)
1171+ where mkt (d, rc, inj, a, t, m) = rc
11541172
11551173lookupInjectiveExact :: Name -> Context -> Maybe Injectivity
11561174lookupInjectiveExact n ctxt = fmap mkt $ lookupCtxtExact n (definitions ctxt)
1157− where mkt (d, inj, a, t, m) = inj
1175+ where mkt (d, _, inj, a, t, m) = inj
11581176
11591177-- Check if a name is reducible in the type checker. Partial definitions
11601178-- are not reducible (so treated as a constant)
@@ -1166,10 +1184,10 @@ tcReducible n ctxt = case lookupTotalExact n ctxt of
11661184
11671185lookupMetaInformation :: Name -> Context -> [MetaInformation]
11681186lookupMetaInformation n ctxt = map mkm $ lookupCtxt n (definitions ctxt)
1169− where mkm (d, inj, a, t, m) = m
1187+ where mkm (d, _, inj, a, t, m) = m
11701188
11711189lookupNameTotal :: Name -> Context -> [(Name, Totality)]
1172−lookupNameTotal n = map (\(n, (_, _, _, t, _)) -> (n, t)) . lookupCtxtName n . definitions
1190+lookupNameTotal n = map (\(n, (_, _, _, _, t, _)) -> (n, t)) . lookupCtxtName n . definitions
11731191
11741192
11751193lookupVal :: Name -> Context -> [Value]
src/Idris/Core/Typecheck.hs+3−3
@@ -111,11 +111,11 @@ check' holes tcns ctxt env top
111111 Just msg -> lift $ tfail $ Msg msg
112112 -- If we're elaborating, we don't want the private names; if we're
113113 -- checking an already elaborated term, we do
114− | [P nt n' ty] <- lookupP_all (not holes) False n ctxt
115− = return (P nt n' ty, ty, [])
116− -- If the names are ambiguous, require it to be fully qualified
117114 | [P nt n' ty] <- lookupP_all (not holes) True n ctxt
118115 = return (P nt n' ty, ty, [])
116+-- -- If the names are ambiguous, require it to be fully qualified
117+-- | [P nt n' ty] <- lookupP_all (not holes) True n ctxt
118+-- = return (P nt n' ty, ty, [])
119119 | otherwise = do lift $ tfail $ NoSuchVariable n
120120 where rigSafe True _ _ n = Nothing
121121 rigSafe _ Rig1 RigW n = Just ("Trying to use linear name " ++ show n ++ " in non-linear context")
src/Idris/Elab/Clause.hs+11
@@ -14,6 +14,7 @@ import Idris.Core.CaseTree
1414import Idris.Core.Elaborate hiding (Tactic(..))
1515import Idris.Core.Evaluate
1616import Idris.Core.Execute
17+import Idris.Core.WHNF
1718import Idris.Core.TT
1819import Idris.Core.Typecheck
1920import Idris.Coverage
@@ -286,6 +287,10 @@ elabClauses info' fc opts n_in cs =
286287 Just Public -> mapM_ (checkVisibility fc n Public Public) calls
287288 _ -> return ()
288289 addCalls n calls
290+ let rig = if linearArg (whnfArgs ctxt [] ty)
291+ then Rig1
292+ else RigW
293+ updateContext (setRigCount n (minRig ctxt rig calls))
289294 addIBC (IBCCG n)
290295 _ -> return ()
291296 return ()
@@ -378,6 +383,12 @@ elabClauses info' fc opts n_in cs =
378383 Just t -> return t
379384 Nothing -> ierror (At fc (Msg "No specialisation achieved"))
380385
386+ minRig :: Context -> RigCount -> [Name] -> RigCount
387+ minRig c minr [] = minr
388+ minRig c minr (r : rs) = case lookupRigCountExact r c of
389+ Nothing -> minRig c minr rs
390+ Just rc -> minRig c (min minr rc) rs
391+
381392forceWith :: Ctxt OptInfo -> Term -> Term
382393forceWith opts lhs = -- trace (show lhs ++ "\n==>\n" ++ show (force lhs) ++ "\n----") $
383394 force lhs
src/Idris/Elab/Data.hs+3−4
@@ -120,6 +120,9 @@ elabData info syn doc argDocs fc opts (PDatadecl n nfc t_in dcons)
120120 -- TMP HACK! Make this a data option
121121 updateContext (addDatatype (Data n ttag cty unique cons))
122122 updateContext (setMetaInformation n metainf)
123+ when (any linearArg (map snd cons)) $
124+ updateContext (setRigCount n Rig1)
125+
123126 mapM_ totcheck (zip (repeat fc) (map fst cons))
124127-- mapM_ (checkPositive n) cons
125128
@@ -174,10 +177,6 @@ elabData info syn doc argDocs fc opts (PDatadecl n nfc t_in dcons)
174177 liftname = id -- Is this appropriate?
175178 }
176179
177− linearArg (Bind n (Pi Rig1 _ _ _) sc) = True
178− linearArg (Bind n (Pi _ _ _ _) sc) = linearArg sc
179− linearArg _ = False
180−
181180elabCon :: ElabInfo -> SyntaxInfo -> Name -> Bool ->
182181 Type -> -- for unique kind checking
183182 Type -> -- data type's kind
src/Idris/Elab/Type.hs+5−4
@@ -16,6 +16,7 @@ import Idris.ASTUtils
1616import Idris.Core.CaseTree
1717import Idris.Core.Elaborate hiding (Tactic(..))
1818import Idris.Core.Evaluate
19+import Idris.Core.WHNF
1920import Idris.Core.Execute
2021import Idris.Core.TT
2122import Idris.Core.Typecheck
@@ -132,6 +133,10 @@ buildType info syn fc opts n ty' = do
132133 let fninfo = FnInfo (param_pos 0 pnames cty)
133134 setFnInfo n fninfo
134135 addIBC (IBCFnInfo n fninfo)
136+
137+ -- If we use any types with linear constructor arguments, we'd better
138+ -- make sure they are use-once
139+ linearCheck fc (whnfArgs ctxt [] cty)
135140
136141 return (cty, ckind, ty, inacc)
137142 where
@@ -181,10 +186,6 @@ elabType' norm info syn doc argDocs fc opts n nfc ty' = {- let ty' = piBind (par
181186 let nty' = normalise ctxt [] nty
182187 logElab 2 $ "Rechecked to " ++ show nty'
183188
184− -- If we use any types with linear constructor arguments, we'd better
185− -- make sure they are use-once
186− linearCheck fc nty'
187−
188189 -- Add function name to internals (used for making :addclause know
189190 -- the name unambiguously)
190191 i <- getIState
src/Idris/Elab/Utils.hs+15−7
@@ -602,16 +602,24 @@ setLinear ns tm = tm
602602linearCheck :: FC -> Type -> Idris ()
603603linearCheck fc t = do ist <- getIState
604604 checkArgs ist t
605− where
605+ where
606+ checkNameOK ist f
607+ = case lookupRigCountExact f (tt_ctxt ist) of
608+ Just Rig1 ->
609+ ierror $ At fc $
610+ Msg $ show f ++ " can only appear in a linear binding"
611+ _ -> return ()
612+
606613 checkArgs ist (Bind n (Pi RigW _ ty _) sc)
607− | (P _ f _, _) <- unApply ty
608− = case lookupCtxtExact f (idris_datatypes ist) of
609− Just ti | linear_con ti ->
610− ierror $ At fc $
611− Msg $ show ty ++ " has a linear constructor, so must have count <= 1"
612− _ -> return ()
614+ = do mapM_ (checkNameOK ist) (allTTNames ty)
615+ checkArgs ist (substV (P Bound n Erased) sc)
613616 checkArgs ist (Bind n (Pi _ _ _ _) sc)
614617 = checkArgs ist (substV (P Bound n Erased) sc)
615618 checkArgs ist _ = return ()
616619
620+linearArg :: Type -> Bool
621+linearArg (Bind n (Pi Rig1 _ _ _) sc) = True
622+linearArg (Bind n (Pi _ _ _ _) sc) = linearArg sc
623+linearArg _ = False
624+
617625
src/Idris/IBC.hs+1−1
@@ -47,7 +47,7 @@ import System.Directory
4747import System.FilePath
4848
4949ibcVersion :: Word16
50−ibcVersion = 159
50+ibcVersion = 160
5151
5252-- | When IBC is being loaded - we'll load different things (and omit
5353-- different structures/definitions) depending on which phase we're in.
src/Idris/TypeSearch.hs+2−2
@@ -104,8 +104,8 @@ searchPred istate ty1 = matcher where
104104 matcher = matchTypesBulk istate maxScore ty1
105105
106106
107−typeFromDef :: (Def, i, b, c, d) -> Maybe Type
108−typeFromDef (def, _, _, _, _) = get def where
107+typeFromDef :: (Def, r, i, b, c, d) -> Maybe Type
108+typeFromDef (def, _, _, _, _, _) = get def where
109109 get :: Def -> Maybe Type
110110 get (Function ty _) = Just ty
111111 get (TyDecl _ ty) = Just ty