Open GoogleCodeExporter opened 9 years ago
Thanks for your work.
// I wonder if this could be generalized for any monoid.
Yes, but you need to wrap it.
In fact it is already in the library as the Writer Monad, but it's missing his
applicative instance.
However, because every Monad is an Applicative Functor, you can always use ap:
(+) <<|> (Writer (3 , [44;55] )) </ap/> ( Writer (9, [1;2]) )
Regarding general functor/applicative compsition, looks interesting. Do you
have code (obviously in Haskell) samples?
Original comment by gustavo....@gmail.com
on 30 Jul 2012 at 10:21
Thanks, I didn't see the connection to the Writer monad.
Here's a simple example of applicative composition, composing the unwrapped
Writer with itself: https://gist.github.com/3227164
Original comment by mauricio...@gmail.com
on 1 Aug 2012 at 2:14
Thanks, very interesting.
Yes, it is also possible to encode it.
See the attached file (tested with revision 118).
Feel free add it to the project if you want.
Original comment by gustavo....@gmail.com
on 19 Aug 2012 at 10:09
Attachments:
Amazing! It's going to take me some time to understand how that works :-)
Original comment by mauricio...@gmail.com
on 19 Aug 2012 at 10:45
Here's the full code.
Original comment by gustavo....@gmail.com
on 20 Aug 2012 at 5:24
Attachments:
Original issue reported on code.google.com by
mauricio...@gmail.com
on 28 Jul 2012 at 10:58