[Haskell] Context of a pattern variable

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Jan 12 07:18:07 EST 2005


On Wed, Jan 12, 2005 at 11:47:51AM +0000, Malcolm Wallace wrote:
> Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> writes:
> 
> >     Marcus Mohnen, "Context Patterns", Proceedings of IFL'96 (LNCS 1268)
> >     Marcus Mohnen, "Context Patterns II", Proceedings of IFL'97 (LNCS 1467)
> 
> There is a web page too, with an implementation of context patterns
> for an old (2.01) version of ghc:
> 
> http://www-i2.informatik.rwth-aachen.de/Staff/Current/mohnen/CP/index.html

Wow, this gives much more than my proposal. 

Actually, it seems to be a similar, but different idea. Mohnen's patterns must
(AFAICS) be compiled to a pattern _search_ algorithm, while "mine" can be
implemented with very simple code transformation. 

Also, I am not sure what this expressions should evaluate to:

    case ([1], [2]) of
        (c [x]) -> c []

Will it be ([], [2]) or ([1], []) ? Perhaps I should just RTFP (Read
The Fine Paper).

Thanks!
Tomasz


More information about the Haskell mailing list