回答这个问题有点棘手,因为没有真正的问题,但编译器不高兴,因为类型可能是
同构的
但它们不是同义词
ErrorT
这样:
newtype ErrorT e m a = ErrorT m (Either e a)
^^^^^^
see here
你已经在你的另一个问题中提到了这一点-这是像
return (Left "Hello") :: IO (Either String Integer)
和
ErrorT (return (Left "Hello")) :: ErrorT String IO Integer