Home > Back-end >  Getting info on a Kind inference bug in GHC
Getting info on a Kind inference bug in GHC

Time:02-22

Edward Kmett reported a bug in kind inference which is pretty annoying for his category library some time ago.

I can't tell if this has been solved or not in some later version of GHC. It seems to be present in 8.10.7 and 9.0.2.

{-# LANGUAGE PolyKinds #-}
class D a => C (f :: k) a
class C () a => D a
data W f (a :: k) where
  MkW :: W Maybe Int -> W f a

How to get information on this (like : will it be solved or not) ?

CodePudding user response:

This does not answer the question that was asked ("when will the bug be fixed?"), but I think it might be useful to know that adding explicit kind signatures makes this compile with GHC 8.10.5 and GHC >= 9 (provided some extensions are enabled).

-- extensions for GHC 8.10.5
{-# LANGUAGE UndecidableInstances, ExplicitForAll,
    PolyKinds, UndecidableSuperClasses, 
    StandaloneKindSignatures, MultiParamTypeClasses,
    FlexibleContexts #-}

import Data.Kind

type D :: Type -> Constraint
type C :: forall k. k -> Type -> Constraint

class D a => C (f :: k) a
class C () a => D (a :: *)
  • Related