这段代码没有被编译是否有一些原因:
type family Foo a b :: Bool where
Foo a b = a == b
foo :: Foo a b ~ True => Proxy a -> Proxy b
foo _ = Proxy
bar :: Proxy a -> Proxy a
bar = foo
有错误:
Couldn't match type ‘a == a’ with ‘'True’
Expected type: 'True
Actual type: Foo a a
但是如果我将类型族定义更改为
type family Foo a b :: Bool where
Foo a a = True
Foo a b = False
它编译好了吗?
(ghc-7.10.3)