On Fri, Nov 21, 2008 at 2:15 PM, Dmitry Kurochkin <
[EMAIL PROTECTED]> wrote:

> Hi Eric, Jason.
>
> On Fri, Nov 21, 2008 at 9:07 PM, Eric Kow <[EMAIL PROTECTED]> wrote:
> > Dmitry,
> >
> > Care to have a look?  I think it should be straightforward...
> >
>
> I have looked at the patch and it is fine. Does what description says.
>
> Question just for me to understand better, the reason this is needed
> is explicit type signature for case expressions?


GHC HQ keeps trying to make GADTs type check in a theoretically sound way.
 I know for sure that in GHC 6.6 you could do some things that were not good
and the type checker would still accept it.  The downside of this, is that
GADTs become less and less user friendly.  Initially, you couldn't do a GADT
pattern patch that involved existentials in a where/let.  Which is mildly
annoying but you could use a case-expression to get around it, a gratuitous
bind/return in a monad, or introduce a lambda or a local function.  As of
6.8, many uses case-expressions became illegal, local functions need a type
signature and this may be true of lambda's too but we don't use that
approach much with GADTs.  As of 6.10, pretty much any use of a
case-expression is now illegal.

You can find more information here:
http://haskell.org/haskellwiki/Upgrading_packages%23Changes_to_GADT_matching#Changes_to_GADT_matching

These cases seem to be us getting bit by the part, "GHC must know the result
type of the match at the match point."

I showed the code snippet of the first patch to Simon PJ and he just sent me
that link to the wiki so I guess it's intended behavior.  I would have
thought with all the rigid types in that code that it should be fine and
that GHC is overreacting.

I hope that helps.  I meant to say more of this when I sent the patches in
but it slipped my mind.

You can also read the wobbly types paper by Simon which gives the
theoretical problems they are solving by making this more strict.

Jason
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to