[Haskell-cafe] View patterns

Andrew Coppin andrewcoppin at btinternet.com
Sat Feb 27 13:55:59 EST 2010


Ozgur Akgun wrote:
> A humble suggestion: Have a *lazy* "to list" method for your /lists, 
> arrays, sets, etc./ and use the nice list-only version.

Yeah, that works quite nicely.

It won't work for arbitrarily complex structures, however. My main point 
was that if you make the constructors abstract and provide functions to 
query the structure, now you can't pattern match against it.



More information about the Haskell-Cafe mailing list