[Haskell-cafe] conflicting variable definitions in pattern

Lennart Augustsson lennart at augustsson.net
Fri May 15 07:07:50 EDT 2009


In the original language design the Haskell committee considered
allowing multiple occurrences of the same variable in a pattern (with
the suggested equality tests), but it was rejected in favour of
simplicity.

  -- Lennart

On Fri, May 15, 2009 at 11:30 AM, Sittampalam, Ganesh
<ganesh.sittampalam at credit-suisse.com> wrote:
> Conor McBride wrote:
>> On 15 May 2009, at 09:11, Sittampalam, Ganesh wrote:
>>>
>>> but then pattern matching can introduce Eq constraints which some
>>> might see as a bit odd.
>>
>> Doesn't seem that odd to me. Plenty of other language features come
>> with constraints attached.
>
> It's the introduction of a constraint from tweaking a pattern that is
> odd, I think. By way of precedent H98 rejected this kind of idea in
> favour of putting 'fail' into Monad.
>
> Ganesh
>
> ===============================================================================
>  Please access the attached hyperlink for an important electronic communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>  ===============================================================================
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list