- -- abstract function which is strict in its i'th
- -- argument if the i'th element of the Demand
- -- list so indicates.
- -- The list of arguments is always non-empty.
- -- In effect, AbsApproxFun [] = AbsTop
+ AbsVal -- abstract function which is strict in its
+ -- arguments if the Demand so indicates.
+ -- INVARIANT: the [Demand] is non-empty
+
+ -- AbsApproxFun has to take a *list* of demands, no just one,
+ -- because function spaces are now lifted. Hence, (f bot top)
+ -- might be bot, but the partial application (f bot) is a *function*,
+ -- not bot.
+
+mkAbsApproxFun :: Demand -> AbsVal -> AbsVal
+mkAbsApproxFun d (AbsApproxFun ds val) = AbsApproxFun (d:ds) val
+mkAbsApproxFun d val = AbsApproxFun [d] val