Skip to content

Unknown type variables while pretty-printing wildcard inferred quantified types #2638

Description

@hdgarrood

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions