type family creates a type synonym, which should not be created
Summary
We can use types that never allowed (example below)
Steps to reproduce
λ> :set -XTypeFamilies -XMultiParamTypeClasses -XFlexibleInstances -XUndecidableInstances
λ> :{
class HasX a where
type X a
instance Eq a => HasX a where
type X a = a
:}
λ> :kind! X (IO Int)
X (IO Int) :: *
= IO Int
λ> z :: X (IO String) ; z = getLine
λ> z
1
"1"
Please provide a set of concrete steps to reproduce the issue.
Expected behavior
X (IO Int) is not equivalent IO Int , cause we have type X a = a only for Eq types
Environment
- GHC version used: 8.8.4