Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
bindLambdas :: Prog0 -> PassM Prog0 Source #
Let bind all anonymous lambdas.
map (x -> x + 1) [1,2,3]
becomes
let lam_1 = (x -> x + 1) in map lam_1 [1,2,3]
This is an intermediate step before the specializer turns the let bound lambdas into top-level functions.
specLambdas :: Prog0 -> PassM Prog0 Source #
Specialization, only lambdas for now. E.g.
foo :: (a -> b) -> a -> b foo f1 a = f1 a
... foo top1 x ...
becomes
foo f1 a = ...
foo2 :: a -> b foo2 a = top1 a
... foo2 x ...