[Haskell] Re: View patterns in GHC: Request for feedback
claus.reinke at talk21.com
Wed Jul 25 05:48:42 EDT 2007
> The whole point of a view is that you make views that are semantically
> data UsefulView = Unit | Arrow Type Type
> usefulView :: Type -> UsefulView
> size :: Type -> Integer
> size (usefulView -> Unit) = 1
> size (usefulView -> Arrow t1 t2) = size t1 + size t2
yes, but my point (of view;) was that i was more interested in
abstracting over patterns than in creating concrete view types.
so, you're interested in views, i'm interested in abstract patterns,
and view patterns help with both (each exhaustive set of abstract
patterns correspondes to a virtual view), even though they're
possibly not the last word on either.
More information about the Haskell