class - Haskell monoid foldable rose tree -
I need to create an alliance frequency for the data structure of the rose tree: Data rose a = a: & gt; [Daily A] Deriving (eq, show) with the following monoides and rosary-related classes / instances: Example factor everyday where fmap f ( A: & gt; BS) = (FA): & gt; (Map (FMAP F) BS) Class Monoid A where Mempati :: A ( :: A -> A - & gt; An example monoid [a] where mempty = [] ( Whatever I tried: Example Foldable Rose where fold (A:> B) = a & Gt; (FoldMapMap b) Although this is not working properly, I get an error to check the system: *** Fail! Exception: 'Prelude. Delayed ': []: & gt; [] But I'm not sure why this does not work, can someone help me? Thanks in advance! Best Regards, Skyfather Your implementation of fold was right, there is no reason to change it. The problem is that it is not enough to define fold Foldable square foldable where the source Data structures can be combined...