Unit unboxed tuples

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Wed Dec 28 23:33:58 CET 2011


Quoting Simon Peyton-Jones <simonpj at microsoft.com>:

> for example.  Singleton unboxed tuples are a perfectly valid data  
> type; it's just that we don't (now) have a name for their constructor.

Well, Haskell *does* have a mechanism for giving two different  
implementations to a particular name...

class UnboxedUnit a where (# #) :: a
instance UnboxedUnit (##)
instance UnboxedUnit (a -> (# a #))

That only leaves solving the equivalent problem for the type-level name (# #).

~d



More information about the Glasgow-haskell-users mailing list