@@ -115,19 +115,17 @@ data Elab : Type -> Type where
115 prim__LookupTy : TTName -> Elab (List (TTName, NameType, TT))
115 prim__LookupTy : TTName -> Elab (List (TTName, NameType, TT))
116 prim__LookupDatatype : TTName -> Elab (List Datatype)
116 prim__LookupDatatype : TTName -> Elab (List Datatype)
118− prim__Check : Raw -> Elab (TT, TT)
118+ prim__Check : List (TTName, Binder TT) -> Raw -> Elab (TT, TT)
120 prim__SourceLocation : Elab SourceLocation
120 prim__SourceLocation : Elab SourceLocation
121 prim__Namespace : Elab (List String)
121 prim__Namespace : Elab (List String)
123− prim__Forget : TT -> Elab Raw
125 prim__Gensym : String -> Elab TTName
123 prim__Gensym : String -> Elab TTName
127 prim__Solve : Elab ()
125 prim__Solve : Elab ()
128 prim__Fill : Raw -> Elab ()
126 prim__Fill : Raw -> Elab ()
129− prim__Apply : Raw -> List (Bool, Int) -> Elab (List (TTName, TTName))
127+ prim__Apply : Raw -> List Bool -> Elab (List (TTName, TTName))
130− prim__MatchApply : Raw -> List (Bool, Int) -> Elab (List (TTName, TTName))
128+ prim__MatchApply : Raw -> List Bool -> Elab (List (TTName, TTName))
131 prim__Focus : TTName -> Elab ()
129 prim__Focus : TTName -> Elab ()
132 prim__Unfocus : TTName -> Elab ()
130 prim__Unfocus : TTName -> Elab ()
133 prim__Attack : Elab ()
131 prim__Attack : Elab ()
@@ -187,7 +185,7 @@ namespace Tactics
187 ||| Halt elaboration with an error
185 ||| Halt elaboration with an error
188 fail : List ErrorReportPart -> Elab a
186 fail : List ErrorReportPart -> Elab a
189 fail err = prim__Fail err
187 fail err = prim__Fail err
191 ||| Look up the lexical binding at the focused hole. Fails if no holes are present.
189 ||| Look up the lexical binding at the focused hole. Fails if no holes are present.
192 getEnv : Elab (List (TTName, Binder TT))
190 getEnv : Elab (List (TTName, Binder TT))
193 getEnv = prim__Env
191 getEnv = prim__Env
@@ -231,18 +229,11 @@ namespace Tactics
231 xs => fail [TextPart "More than one datatype named", NamePart n]
229 xs => fail [TextPart "More than one datatype named", NamePart n]
233 ||| Attempt to type-check a term, getting back itself and its type.
231 ||| Attempt to type-check a term, getting back itself and its type.
233+ ||| @ env the environment within which to check the type
234+ ||| @ tm the term to check
234− check : (tm : Raw) -> Elab (TT, TT)
235+ check : (env : List (TTName, Binder TT)) -> (tm : Raw) -> Elab (TT, TT)
235− check tm = prim__Check tm
236+ check env tm = prim__Check env tm
237− ||| Convert a type-annotated reflected term to its untyped
239− forgetTypes : TT -> Elab Raw
240− forgetTypes tt = prim__Forget tt
242− ||| Get the goal type as a Raw term. Fails if there are no holes.
244− goalType = do g <- getGoal
248 ||| Generate a unique name based on some hint.
239 ||| Generate a unique name based on some hint.
@@ -278,10 +269,8 @@ namespace Tactics
278 ||| where the Boolean states whether or not to attempt to solve
269 ||| where the Boolean states whether or not to attempt to solve
279 ||| the argument and the Int gives the priority in which to do
270 ||| the argument and the Int gives the priority in which to do
281− apply : (op : Raw) ->
282− (argSpec : List (Bool, Int)) ->
272+ apply : (op : Raw) -> (argSpec : List Bool) -> Elab (List TTName)
283− Elab (List (TTName, TTName))
284− apply tm argSpec = prim__Apply tm argSpec
273+ apply tm argSpec = map snd <$> prim__Apply tm argSpec
286 ||| Attempt to apply an operator to fill the current hole,
275 ||| Attempt to apply an operator to fill the current hole,
287 ||| potentially solving arugments by matching.
276 ||| potentially solving arugments by matching.
@@ -300,10 +289,8 @@ namespace Tactics
300 ||| where the Boolean states whether or not to attempt to solve
289 ||| where the Boolean states whether or not to attempt to solve
301 ||| the argument and the Int gives the priority in which to do
290 ||| the argument and the Int gives the priority in which to do
303− matchApply : (op : Raw) ->
292+ matchApply : (op : Raw) -> (argSpec : List Bool) -> Elab (List TTName)
304− (argSpec : List (Bool, Int)) ->
305− Elab (List (TTName, TTName))
306− matchApply tm argSpec = prim__Apply tm argSpec
293+ matchApply tm argSpec = map snd <$> prim__Apply tm argSpec
308 ||| Move the focus to the specified hole. Fails if the hole does not
295 ||| Move the focus to the specified hole. Fails if the hole does not
309 ||| exist.
296 ||| exist.