+datatype decl' =
+ DExternType of string
+ | DExternVal of string * typ
+ | DVal of string * typ option * exp
+ | DContext of string
+type decl = decl' * string option * position
+
+type file = string option * decl list * exp option
+
+fun multiApp (f, loc, args) =
+ foldl (fn (arg, e) => (EApp (e, arg), loc)) f args