For example:
> :type const :: forall a. a -> _
forall a t1. a -> t1 -> a0
Unfortunately a0 is not in scope, so this won't typecheck if I paste it into a source file. I was expecting psci to report the type as forall a t1. a -> t1 -> a.
This isn't just a psci issue; the compiler warnings for type wildcards seem to exhibit the same issue.
However, if I write the following in a source file:
myConst :: forall a. a -> _
myConst = const
and then apply the suggestion that psc-ide gives me, it does not seem to suffer from this problem; the result is:
myConst :: forall a. a -> _ -> a
myConst = const
It would be nice if applying the suggestion would have introduced a new type variable in the type signature for myConst so that no wildcards were needed though. Is that a separate issue? (edit: yes. See #2640)
For example:
Unfortunately
a0is not in scope, so this won't typecheck if I paste it into a source file. I was expecting psci to report the type asforall a t1. a -> t1 -> a.This isn't just a psci issue; the compiler warnings for type wildcards seem to exhibit the same issue.
However, if I write the following in a source file:and then apply the suggestion that psc-ide gives me, it does not seem to suffer from this problem; the result is:It would be nice if applying the suggestion would have introduced a new type variable in the type signature for(edit: yes. See #2640)myConstso that no wildcards were needed though. Is that a separate issue?