Non-exhaustive pattern match(es) warning in lambda functions

Mitar mmitar at gmail.com
Thu Nov 18 06:20:31 EST 2010


Hi!

On Wed, Nov 17, 2010 at 11:52 AM, Sittampalam, Ganesh
<ganesh.sittampalam at credit-suisse.com> wrote:
> If GHC added support "or" patterns, you could write them out quite
> concisely:
>
> bar Foo1 Foo2 Foo3 = ...
> bar (Foo1|Foo2|Foo3) (Foo1|Foo2|Foo3) (Foo1|Foo2|Foo3) = error "..."

Uh. Still no nice solution.

But this is a form of closed world assumption. When you write _ as a
case you in fact use this assumption. But when you later on extend the
"world" with some new case, this assumption could not really hold
anymore.


Mitar


More information about the Glasgow-haskell-users mailing list