[Haskell-cafe] Hidden types and scope
sandeep at sras.me
Wed Jul 10 16:03:33 UTC 2019
>What is the reason case and let expressions are treated differently in
Please check the section "184.108.40.206. Restrictions section" in
>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.
On 10/07/19 9:26 PM, Lana Black wrote:
> A followup question. What is the reason case and let expressions are
> treated differently in this case? I can see the error message saying
> about the type variable escaping its scope, but I don't understand how
> exactly this can happen with let.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
More information about the Haskell-Cafe