[Haskell-beginners] Foldable of Foldable

Tony Morris tonymorris at gmail.com
Fri Jan 2 15:16:35 UTC 2015


A foldable of a foldable is itself foldable. That fact is expressed in 
Control.Compose:

https://hackage.haskell.org/package/TypeCompose-0.9.10/docs/Control-Compose.html

instance (Foldable g, Foldable f, Functor g) => Foldable (:. g f)

On 03/01/15 01:14, Julian Birch wrote:
> Apologies if this isn't clear, I suspect if I understood the 
> terminology better I'd already have solved the problem. I've got a 
> foldable of a foldable of a.  (Specifically `[Set a]`) and I want to 
> be able to express the concept that I can treat `(Foldable f1, 
> Foldable f2) => f1 (f2 a)` as `f3 a` i.e. a foldable of a foldable of 
> a can be newtyped to a foldable of a.  At least, I think that's right.
>
> Sadly, my attempts at actually expressing this concept have met with 
> incomprehension from GHC, could someone help me out, please?
>
> Thanks,
>
> Julian.
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20150103/14ad04e3/attachment.html>


More information about the Beginners mailing list