@@ -40,17 +40,30 @@ getUName (UN n) = Just n
4040getUName (NS n ns) = getUName n
4141getUName _ = Nothing
4242
43−total
44−unApply : TT -> (TT, List TT)
45−unApply t = unA t []
46− where unA : TT -> List TT -> (TT, List TT)
47− unA (App fn arg) args = unA fn (arg::args)
48− unA tm args = (tm, args)
43+namespace TT
44+ total
45+ unApply : TT -> (TT, List TT)
46+ unApply t = unA t []
47+ where unA : TT -> List TT -> (TT, List TT)
48+ unA (App fn arg) args = unA fn (arg::args)
49+ unA tm args = (tm, args)
50+
51+ total
52+ mkApp : Foldable f => TT -> f TT -> TT
53+ mkApp f args = foldl App f args
54+
55+namespace Raw
56+ total
57+ unApply : Raw -> (Raw, List Raw)
58+ unApply tm = unApply' tm []
59+ where unApply' : Raw -> List Raw -> (Raw, List Raw)
60+ unApply' (RApp f x) xs = unApply' f (x::xs)
61+ unApply' notApp xs = (notApp, xs)
62+
63+ total
64+ mkApp : Foldable f => Raw -> f Raw -> Raw
65+ mkApp f args = foldl RApp f args
4966
50−total
51−mkApp : TT -> List TT -> TT
52−mkApp tm [] = tm
53−mkApp tm (a::as) = mkApp (App tm a) as
5467
5568total
5669binderTy : Binder t -> t