@@ -3,17 +3,17 @@ module Language.Reflection.Utils
33import Language.Reflection
44import Language.Reflection.Errors
55
6−%default total
7−
86--------------------------------------------------------
97-- Tactic construction conveniences
108--------------------------------------------------------
119
10+total
1211seq : List Tactic -> Tactic
1312seq [] = GoalType "This is an impossible case" Trivial
1413seq [t] = t
1514seq (t::ts) = t `Seq` seq ts
1615
16+total
1717try : List Tactic -> Tactic
1818try [] = GoalType "This is an impossible case" Trivial
1919try [t] = t
@@ -23,6 +23,7 @@ try (t::ts) = t `Try` seq ts
2323--------------------------------------------------------
2424-- For use in tactic scripts
2525--------------------------------------------------------
26+total
2627mkPair : a -> b -> (a, b)
2728mkPair a b = (a, b)
2829
@@ -30,22 +31,25 @@ mkPair a b = (a, b)
3031--------------------------------------------------------
3132-- Tools for constructing proof terms directly
3233--------------------------------------------------------
33−
34+total
3435getUName : TTName -> Maybe String
3536getUName (UN n) = Just n
3637getUName (NS n ns) = getUName n
3738getUName _ = Nothing
3839
40+total
3941unApply : TT -> (TT, List TT)
4042unApply t = unA t []
4143 where unA : TT -> List TT -> (TT, List TT)
4244 unA (App fn arg) args = unA fn (arg::args)
4345 unA tm args = (tm, args)
4446
47+total
4548mkApp : TT -> List TT -> TT
4649mkApp tm [] = tm
4750mkApp tm (a::as) = mkApp (App tm a) as
4851
52+total
4953binderTy : (Eq t) => Binder t -> t
5054binderTy (Lam t) = t
5155binderTy (Pi t _) = t