从HXT包中的ArrowList
类具有以下声明:是否有必要在类声明的类上下文中指定每个超类?
class (Arrow a, ArrowPlus a, ArrowZero a, ArrowApply a) => ArrowList a where
...
的ArrowPlus
类被声明为: class ArrowZero a => ArrowPlus a where
...
的ArrowZero
类被声明为: class Arrow a => ArrowZero a where
...
而ArrowApply
类声明为: class Arrow a => ArrowApply a where
...
为什么不能把它写成: class (ArrowPlus a, ArrowApply a) => ArrowList a where
...?
这很有趣...我认为它可以。 – luqui
为什么不试试呢? – fuz