[<<][haskell][>>][..]
Thu May 31 13:23:12 EDT 2018

Free fold

Free seems to be genuinely useful, but I'm having a hard time getting
used to the interface.

I want to monadically iterate over the leaf nodes, but each time we're
going one level deeper I want to inspect that node and take some
monadic action before continuing descend.

Proably liftF and retract?

Simplified: I want to look at each Free Functor node.

iterM :: (Monad m, Functor f) => (f (m a) -> m a) -> Free f a -> m a 

I don't get it.  Simpler example.


Ok this can be used for creating bindings, where a instance is
replaced by a reference that can be incorporated in another node.

What I need is the other way around: for each leaf node, I want to
accumulate its contents.

I.e. I want to look at the tag of the list first.
That's possible.

Ok, that's it.




[Reply][About]
[<<][haskell][>>][..]