Yes but as I understood it the type inferer was taking your type annotation
for granted, and apparently in fact it re-specifies it.
What you said was in reality:
> f :: forall. a -> a
> f x = undefined :: forall a1. a1
And it turned it into:
f :: forall. a -> a
f x = undefined :: a
(here, 'a' would be *scoped*)

There's something I don't get...

2012/1/4 Yucheng Zhang <yczhan...@gmail.com>

> On Wed, Jan 4, 2012 at 9:41 PM, Yves Parès <limestr...@gmail.com> wrote:
> > Would you try:
> >
> > f :: a -> a
> > f x = undefined :: a
> >
> > And tell me if it works? IMO it doesn't.
>
> It works.
>
> As I understand, in this situation we are specializing the 'undefined
> :: forall a. a'
> to a more specific dependent type.
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to