
3 Oct
2008
3 Oct
'08
5:20 p.m.
On Fri, 2008-10-03 at 15:38 -0400, David Menendez wrote:
On Fri, Oct 3, 2008 at 3:17 AM, Jason Dusek
wrote: Perhaps I am lacking in imagination, but I still can't see the value of one tuples.
You can use them to defeat seq.
undefined `seq` x == undefined OneTuple undefined `seq` x == x
That might be useful if a polymorphic function is using seq to force evaluation, and you don't want it to. But I can't imagine that coming up much in practice.
Think element strict polymorphic containers, e.g. data HeadStrictList a = Nil | Cons !a (HeadStrictList a) then type LazyList a = HeadStrictList (OneTuple a)