A few hours ago, I built the GHC HEAD to experiment with the new shiny closed family types.
{-
Now I'm trying to use C to use:
class Combine ab where combine :: a -> b -> C ab instance Combine a [a] where combine ab = a : b instance Combine aa where combine ab = [a, b]
Which leads to this error:
Couldn't match expected type ‛C a a' with actual type ‛[a]' ... In the expression: [a, b] In an equation for ‛combine': combine ab = [a, b] In the instance declaration for ‛Combine a a'
It seems to me that the second equation is different from the first ( [a] a cannot be simplified to aa , regardless of what a ), so why doesn't it compile?
haskell type-families
Artyom
source share