To me it looks more like a bug in GHC 7.6 TBH.
If you remove the syntax sugar for function types, what you have is
type instance BoundsOf (((->) a) a) = Int
type instance BoundsOf (((->) a) (((->) a) a)) = (Int, Int)
which looks conflicting...
Now, if I try to pull this same trick with another type constructor instead of ((->) a)
, I get an error from GHC 7.6 as well:
{-# LANGUAGE TypeFamilies #-}
type family BoundsOf x
type instance BoundsOf (Maybe a) = Int
type instance BoundsOf (Maybe (Maybe a)) = (Int, Int)
Which results in:
tyfams.hs:4:15:
Conflicting family instance declarations:
type instance BoundsOf (Maybe a) -- Defined at tyfams.hs:4:15
type instance BoundsOf (Maybe (Maybe a)) -- Defined at tyfams.hs:5:15
I don't see why it should work for ((->) a)
.