In Haskell, I can write
data CoAttr f a
= Automatic a
| Manual (f (CoAttr f a))
but Idris doesn't seem to allow such fix-point types with data
. They do work with record
, i.e. I can write
record CoAttrWithoutAutomatic (f : Type -> Type) where
constructor Manual
out : f (CoAttrWithoutAutomatic f)
but there I can't have more than one variant if I understand right. Is there a solution?
Got it – I missed the general form of defining data types: