purescript-deprecated/purescript-monoid

stack-safe Endo

Closed this issue · 2 comments

This would make it safe to foldMap into an Endofunctor. @natefaubion I recall you making something like this on Slack at some point.

You can use an efficient Free Monoid representation. I used an Array for demo purposes, but you can also use CatList, which is what purescript-free uses.

Sadly, using CatList here would create a dependency loop. It does seem like the right datatype, though. Perhaps the best approach is to create a separate lib for this :/