[Haskell-cafe] conflicting variable definitions in pattern
Miguel Mitrofanov
miguelimo38 at yandex.ru
Fri May 15 04:09:34 EDT 2009
What would you expect
foo [id, \x -> x]
to be?
Martin Hofmann wrote on 15.05.2009 12:09:
> It is pretty clear, that the following is not a valid Haskell pattern:
>
> foo (x:x:xs) = x:xs
>
> My questions is _why_ this is not allowed. IMHO, the semantics should be
> clear: The pattern is expected to succeed, iff 'x' is each time bound to
> the same term.
>
> Isn't this allowed, because this would require a strict evaluation of
> the 'x' variables?
>
> Thanks,
>
> Martin
>
> _______________________________________________
> 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