@@ -56,6 +56,7 @@ data IState = IState { tt_ctxt :: Context,
56 idris_patdefs :: Ctxt [([Name], Term, Term)], -- not exported
56 idris_patdefs :: Ctxt [([Name], Term, Term)], -- not exported
57 idris_flags :: Ctxt [FnOpt],
57 idris_flags :: Ctxt [FnOpt],
58 idris_callgraph :: Ctxt [Name],
58 idris_callgraph :: Ctxt [Name],
59+ idris_calledgraph :: Ctxt [Name],
59 idris_totcheck :: [(FC, Name)],
60 idris_totcheck :: [(FC, Name)],
60 idris_log :: String,
61 idris_log :: String,
61 idris_options :: IOption,
62 idris_options :: IOption,
@@ -103,7 +104,7 @@ data IBCWrite = IBCFix FixDecl
104idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
105idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
105 emptyContext emptyContext emptyContext emptyContext
106 emptyContext emptyContext emptyContext emptyContext
106− emptyContext emptyContext
107+ emptyContext emptyContext emptyContext
107 [] "" defaultOpts 6 [] [] [] [] [] [] [] []
108 [] "" defaultOpts 6 [] [] [] [] [] [] [] []
108 Nothing Nothing Nothing [] [] [] Hidden [] Nothing
109 Nothing Nothing Nothing [] [] [] Hidden [] Nothing
@@ -158,6 +159,9 @@ addToCG :: Name -> [Name] -> Idris ()
158addToCG n ns = do i <- get
159addToCG n ns = do i <- get
159 put (i { idris_callgraph = addDef n ns (idris_callgraph i) })
160 put (i { idris_callgraph = addDef n ns (idris_callgraph i) })
162+addToCalledG :: Name -> [Name] -> Idris ()
163+addToCalledG n ns = return () -- TODO
161-- Add a class instance function. Dodgy hack: Put integer instances first in the
165-- Add a class instance function. Dodgy hack: Put integer instances first in the
162-- list so they are resolved by default.
166-- list so they are resolved by default.
@@ -1658,14 +1662,17 @@ aiFn inpat ist fc f as
1658 insertImpl (PTacImplicit p l n sc ty : ps) given =
1662 insertImpl (PTacImplicit p l n sc ty : ps) given =
1659 case find n given [] of
1663 case find n given [] of
1660 Just (tm, given') -> PTacImplicit p l n sc tm : insertImpl ps given'
1664 Just (tm, given') -> PTacImplicit p l n sc tm : insertImpl ps given'
1661− Nothing -> PTacImplicit p l n sc sc
1665+ Nothing -> if inpat
1666+ then PTacImplicit p l n sc Placeholder : insertImpl ps given
1662− : insertImpl ps given
1667+ else PTacImplicit p l n sc sc : insertImpl ps given
1663 insertImpl expected [] = []
1668 insertImpl expected [] = []
1664 insertImpl _ given = given
1669 insertImpl _ given = given
1666 find n [] acc = Nothing
1671 find n [] acc = Nothing
1667 find n (PImp _ _ n' t : gs) acc
1672 find n (PImp _ _ n' t : gs) acc
1668 | n == n' = Just (t, reverse acc ++ gs)
1673 | n == n' = Just (t, reverse acc ++ gs)
1674+ find n (PTacImplicit _ _ n' _ t : gs) acc
1675+ | n == n' = Just (t, reverse acc ++ gs)
1669 find n (g : gs) acc = find n gs (g : acc)
1676 find n (g : gs) acc = find n gs (g : acc)
1671mkPApp fc a f [] = f
1678mkPApp fc a f [] = f