There have been some major changes in base library, so I'm wondering whether today idiomatic solution would involve fmap
, Maybe
, Monoid
, First
, Foldable
and maybe other classes.
I figured I would need to fold
a complex structure of a Monoid
with zip [1..]
, First
, a -> Bool
and Maybe
, but couldn't find obvious way to compose these things together.
Also, I suspect most of this code is in libraries. I'm just not sure whether (or how many) newtype
wrappers would I need to compose classes to get a structure I need.