darcs patch: implement prefix unboxed tuples syntax (#1509)
simonmarhaskell at gmail.com
Fri Jan 4 05:36:16 EST 2008
Isaac Dupree wrote:
> would implementing that make it harder or easier for ghci to support
> unboxed tuples?
Slightly easier, in that construction (of unboxed tuples with lifted
components only) could be done by calling the curried construction
functions in PrimopWrappers.
Deconstruction could be done in a similar way; that is we need a family of
liftUbx2 :: (State# -> (# a, b #)) -> (a, b)
the State# argument is just a hack to lift the unboxed tuple. So you could
case f x of
(# a, b #) -> ...
let f' = \s -> f x in
case liftUbx2 f' of
(a, b) -> ...
but this only works for unboxed tuples with lifted components. You could
also generate some similar wrappers for particular instances of unboxed
tuples with unlifted components. Doesn't sound particularly attractive,
More information about the Cvs-ghc