[Haskell] Views in Haskell

Simon Peyton-Jones simonpj at microsoft.com
Thu Jan 25 03:42:18 EST 2007

| First, I'm not clear what Simon meant by "first class abstractions"
| in this comment
| > Several proposals suggest first class abstractions rather that
| > first-class patterns. Here are the ones I know of ...

Sorry to have been un-clear.  By a "first class abstraction" I mean a value of type
        something -> something
with a syntax something like
        \ pattern -> body

The abstraction includes both the pattern and the result.  In contrast, view patterns tackle only the syntax of patterns; the pattern of a first-class abstraction.  I'll update the wiki

A first-class *pattern*, on the other hand, really ought to be something like (a,b), where a and b are *binders*.  This is what Barry Jay means by a first-class pattern in his very interesting work (which I should reference from the wiki).  See "The Patten Calculus" http://www-staff.it.uts.edu.au/~cbj/Publications/chronological.html

Still, I think it's likely that I'm exaggerating, and that view patterns and first-class abstractions are tied up together somehow.  But I don't grok exactly how.


More information about the Haskell-prime mailing list