Transformational Patterns?
Simon Peyton-Jones
simonpj at microsoft.com
Tue Jul 25 12:43:23 EDT 2006
| After reading the paper "Pattern Guards and Transformational Patterns"
| by Martin Erwig and Simon Peyton Jones, I'm left wondering about the
| status of transformational patterns? Can we expect to see these at
| some point in GHC? Or have they gone by the wayside in favor of some
| other alternative?
|
| When I had finished reading the paper, I was disappointed to find out
| that they were not implemented as I was convinced of the merits based
| on the arguments presented in the paper.
We have no immediate plans to add views or transformational patterns to
GHC.
Why not?
a) we already have pattern guards
http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.htm
l#pattern-guards which do part of the job
b) in any language, there is a trade-off between complexity and
expressiveness. It's not immediately clear which side of the line views
lie.
c) there are a number of alternative designs, and no clear winner
Having said that, I think one can make a strong case that some form of
views support is essential to allow abstraction, and that views should
therefore have direct support. Indeed, it's on the table for Haskell
Prime
http://hackage.haskell.org/trac/haskell-prime/wiki/Views
It would be a Good Thing, I believe, if those interested in views and/or
transformational patterns could use the above Wiki to record the various
possible designs, and try to converge on one. Then it might be an
interesting intern project to implement it:
http://hackage.haskell.org/trac/ghc/wiki/Internships
Simon
More information about the Glasgow-haskell-users
mailing list