Local bindings in the static form
facundo.dominguez at tweag.io
Thu Mar 3 19:41:25 UTC 2016
At Tweag I/O we are considering relaxing a bit the constraints on
the static form.
demands <exp> to be closed. That is, the free variables of <exp>
must be bound at the top level.
However, it would be fine to allow local bindings too. For instance:
test :: StaticPtr ([[Int]] -> [[Int]])
test x = static (filter hasZero)
hasZero = any isZero
isZero = (0 ==)
Where hasZero is local but its body can be considered kind of closed
(all free variables refer to top-level bindings or other *closed*
We would need for this implementation a way to test closedness in this
sense. Could there be any similar test implemented already in GHC?
More information about the ghc-devs