[Haskell] Re: Context of a pattern variable [ERRATA]

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Jan 12 02:12:48 EST 2005


Below are corrections of embarassing mistakes in my examples, pointed out by
Wolfram and Stefan Holdermans.

On Tue, Jan 11, 2005 at 11:12:04PM +0100, Tomasz Zielonka wrote:
> before:
> 
>   case t of
>       (x, y, z) -> (x, y, z+1)
> 
> after:
> 
>   case t of
>       (_, _, ctx @> z) -> ctx z

        (_, _, ctx @> z) -> ctx (z+1)

> BTW, I already see some problems with this syntax. For example, this code
> 
>   case t of
>       (x, y, (a, ctx @> Just z)) -> ctx z
> 
> wouldn't be equivalent to this one
> 
>   case t of
>       (x, y, v) -> 
>           case v of 
>               ctx @> Just z -> ctx z

                (a, ctx @> Just z) -> ctx z

Best regards,
Tomasz


More information about the Haskell mailing list