On Tue, Feb 1, 2011 at 9:52 AM, Max Bolingbroke
<batterseapo...@hotmail.com> wrote:
>
> Local declarations at module scope can be emulated using pattern bindings:
>
> """
> (foo, bar) = (foo, bar)
>  where
>    foo = ..
>    bar = ..
>    private = ...
> """
>
> If instance declarations supported pattern bindings you could get the
> same effect for your instances too. This would be a minimal change
> that avoided introducing any extra syntax.
>

This is kind of ugly, I think, and there are proposals to make pattern
bindings monomorphic which would make this sort of thing no longer
possible in general. I think I would be in favour of a declaration
analogue to let.

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to