[Haskell-cafe] Hidden types and scope
lanablack at amok.cc
Wed Jul 10 16:10:35 UTC 2019
On 10/07/2019 16:03, Sandeep.C.R via Haskell-Cafe wrote:
> >What is the reason case and let expressions are treated differently in
> this case
> Please check the section "220.127.116.11. Restrictions section" in
> It says,
> >In general, you can only pattern-match on an existentially-quantified
> constructor in a case expression or in the patterns of a function
> definition. The reason for this restriction is really an implementation
> one. Type-checking binding groups is already a nightmare without
> existentials complicating the picture. Also an existential pattern
> binding at the top level of a module doesn't make sense, because it's
> not clear how to prevent the existentially-quantified type "escaping".
> So for now, there's a simple-to-state restriction. We'll see how
> annoying it is.
Thank you! That explains it.
More information about the Haskell-Cafe