[Haskell-cafe] Restricted type classes

wren ng thornton wren at freegeek.org
Wed Sep 8 22:21:11 EDT 2010

On 9/7/10 7:26 AM, Neil Brown wrote:
> On 07/09/10 05:24, wren ng thornton wrote:
>> Just that they're not the same thing. For example, ZipList supports
>> pure but it has no meaningful instance of singleton since every
>> ZipList is infinite.
> I don't believe that every ZipList is infinite (if this should be the
> case, the constructor shouldn't be exposed!), just that ZipLists created
> by "pure" are infinite

Just so. I misremembered the data constructor as not being exported.

> So ZipList does have a meaningful definition of singleton (singleton x =
> ZipList [x];

Though we still have singleton /= pure, which is all I was arguing.

Live well,

More information about the Haskell-Cafe mailing list