[Haskell] Views in Haskell

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Jan 31 09:44:29 EST 2007


Hello Rene,

Wednesday, January 24, 2007, 10:49:06 PM, you wrote:

> Going by the traffic over the previous months, I think that class aliases or
> extensible records would be higher on most peoples lists than views.

i think that proper views is a must for Haskell - "We are keen on
abstraction, but pattern matching is so convenient that we break
abstractions all the time. It's our dirty little secret. "

we need views in order to stop dealing with concrete datatypes and
start writing polymorphic functions. just imagine that the following
definition

sum [x]    = x
sum (x:xs) = x + sum xs

may deal with *anything*, from strict list to patricia tree. isn't that
great?


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-prime mailing list