@@ -40,17 +40,30 @@ getUName (UN n) = Just n
40getUName (NS n ns) = getUName n
40getUName (NS n ns) = getUName n
41getUName _ = Nothing
41getUName _ = Nothing
44−unApply : TT -> (TT, List TT)
45+ unApply : TT -> (TT, List TT)
45−unApply t = unA t []
46+ unApply t = unA t []
46− where unA : TT -> List TT -> (TT, List TT)
47+ where unA : TT -> List TT -> (TT, List TT)
47− unA (App fn arg) args = unA fn (arg::args)
48+ unA (App fn arg) args = unA fn (arg::args)
48− unA tm args = (tm, args)
49+ unA tm args = (tm, args)
52+ mkApp : Foldable f => TT -> f TT -> TT
53+ mkApp f args = foldl App f args
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)
64+ mkApp : Foldable f => Raw -> f Raw -> Raw
65+ mkApp f args = foldl RApp f args
51−mkApp : TT -> List TT -> TT
53−mkApp tm (a::as) = mkApp (App tm a) as
56binderTy : Binder t -> t
69binderTy : Binder t -> t