在 Haskell 中,我可以写
data CoAttr f a
= Automatic a
| Manual (f (CoAttr f a))
但 Idris 似乎不允许使用data
. 他们确实合作record
,即我可以写作
record CoAttrWithoutAutomatic (f : Type -> Type) where
constructor Manual
out : f (CoAttrWithoutAutomatic f)
但是如果我理解正确的话,我不能有多个变体。有解决办法吗?