Prefix form of unboxed tuple

John Meacham john at repetae.net
Fri Jul 6 08:08:22 EDT 2007


On Fri, Jul 06, 2007 at 11:26:00AM +0100, Neil Mitchell wrote:
> ghci -fglasgow-exts
> Prelude> case (# 1 , 2 #) of (# a , b #) -> error $ show (a,b)
> *** Exception: (1,2)
> 
> You might expect there to be a prefix form of the unboxed tuple:
> 
> Prelude> case (#,#) 1 2 of (# a , b #) -> error $ show (a,b)
> <interactive>:1:7: parse error on input `,'
> 
> But there isn't. I've added special code into the Yhc code generator
> to deal with this particular constructor, so it no longer effects me.
> 

Well, what would the type of (#,#) be? unboxed tuples can hold both
boxed and unboxed values, so some sort of kind polymorphism would be
needed to type the prefix form properly.


        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Glasgow-haskell-users mailing list