@@ -56,6 +56,7 @@ data IState = IState { tt_ctxt :: Context,
5656 idris_patdefs :: Ctxt [([Name], Term, Term)], -- not exported
5757 idris_flags :: Ctxt [FnOpt],
5858 idris_callgraph :: Ctxt [Name],
59+ idris_calledgraph :: Ctxt [Name],
5960 idris_totcheck :: [(FC, Name)],
6061 idris_log :: String,
6162 idris_options :: IOption,
@@ -103,7 +104,7 @@ data IBCWrite = IBCFix FixDecl
103104
104105idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
105106 emptyContext emptyContext emptyContext emptyContext
106− emptyContext emptyContext
107+ emptyContext emptyContext emptyContext
107108 [] "" defaultOpts 6 [] [] [] [] [] [] [] []
108109 Nothing Nothing Nothing [] [] [] Hidden [] Nothing
109110
@@ -158,6 +159,9 @@ addToCG :: Name -> [Name] -> Idris ()
158159addToCG n ns = do i <- get
159160 put (i { idris_callgraph = addDef n ns (idris_callgraph i) })
160161
162+addToCalledG :: Name -> [Name] -> Idris ()
163+addToCalledG n ns = return () -- TODO
164+
161165-- Add a class instance function. Dodgy hack: Put integer instances first in the
162166-- list so they are resolved by default.
163167
@@ -1658,14 +1662,17 @@ aiFn inpat ist fc f as
16581662 insertImpl (PTacImplicit p l n sc ty : ps) given =
16591663 case find n given [] of
16601664 Just (tm, given') -> PTacImplicit p l n sc tm : insertImpl ps given'
1661− Nothing -> PTacImplicit p l n sc sc
1662− : insertImpl ps given
1665+ Nothing -> if inpat
1666+ then PTacImplicit p l n sc Placeholder : insertImpl ps given
1667+ else PTacImplicit p l n sc sc : insertImpl ps given
16631668 insertImpl expected [] = []
16641669 insertImpl _ given = given
16651670
16661671 find n [] acc = Nothing
16671672 find n (PImp _ _ n' t : gs) acc
16681673 | n == n' = Just (t, reverse acc ++ gs)
1674+ find n (PTacImplicit _ _ n' _ t : gs) acc
1675+ | n == n' = Just (t, reverse acc ++ gs)
16691676 find n (g : gs) acc = find n gs (g : acc)
16701677
16711678mkPApp fc a f [] = f