Haskell Wiki has an example of a non-parametric parameter of a type function:
type family Inspect x
type instance Inspect Age = Int
type instance Inspect Int = Bool
Here x
is non-parametric because to determine the outcome of applying Inspect
to a type argument, the type function must inspect x
.
In this case, the role of x
is nominal. We can declare the role explicitly with the RoleAnnotations
extension:
type role Inspect nominal