Purescript: Kinded types can cause instance solving to fail

Created on 20 Dec 2016  路  3Comments  路  Source: purescript/purescript

I found this whilst working on https://github.com/purescript/purescript/pull/2486

The following works as expected:

eg = show (unit :: Unit)

If we annotate Unit with its kind, it fails:

eg = show (unit :: (Unit :: *))

We get:

No type class instance was found for

    Data.Show.Show (Unit :: *)


while inferring the type of show unit
while applying a function show
  of type forall a. (Show a) => a -> String
  to argument unit
in value declaration eg
bug typechecker

Most helpful comment

Okay I've worked out a solution to this, I'll submit a PR shortly.

All 3 comments

Looks like KindedType is missing from various functions in TypeChecker.Entailment; e.g: typeHeadsAreEqual, typesAreEqual.

Oops, thanks :)

Okay I've worked out a solution to this, I'll submit a PR shortly.

Was this page helpful?
0 / 5 - 0 ratings