Skip to content

type family returning `Constraint` does not require ConstraintKinds

A type family returning a Constraint does not require the ConstraintKinds extension. It is not clear to me if this is a bug or intended. The documentation says that constraints can only be class constraints, implicit parameters or equality constraints (so no type families). It also gives a type family example for a thing that needs ConstraintKinds to be allowed. If this behaviour is intended, the documentation should be updated to reflect that.

Example

{-# LANGUAGE TypeFamilies #-}

module Lib where

import Data.Kind (Constraint)

type family Test :: Constraint where
    Test = ()
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information