Exploring Free Monads in Java on the Social Networking Kata.
- users can post messages
- users can read messages
- users can follow users
- users can see walls including following
The common theme is that the monad chains operations in some specific, useful way.
- How Optional breaks the monad laws and why it matters (2016) ...
map
breaks associativity.
We have talked about monads and interpreters. I said the free monad is just the combination of the two. Concretely this means the free monad provides:
- an AST to express monadic operations;
- an API to write interpreters that give meaning to this AST.
Articles and Presentations
- Dead-Simple Dependency Injection presentation by Runar Oli Bjarnason (2013)
- Free Monad Are Simple blog post by Noel Welsh (2014)
- Gregor's blog post Refactoring towards a transaction monad (2017)
- DSLs with the Free Monad in Java 8 part 1 by John McClean, part 2 (2017)
- Free in Java
- Free Monad in Scala (2022), Scala sample in source.
- Gregor kommt durcheinander mit Java Generics.
- Peter versucht nur, es zu kompilieren.
- Java ist dafür nicht gemacht.
- Typen gleichsetzen geht nicht, muss immer extends, kann keine Functors machen.
- Spassig war's.
- Peter tippt ganze Zeit, OK.
- Wieder reinkommen und mal etwas anderes sehen, andere Sprachen bieten andere Lösungen.
- Energie in etwas investiert, was vielleicht wo anders leichter geht?
- Gregor hat etwas gelernt durch den Scala Artikel, interessant.
- Peter sieht, dass die Java Lösung besser sein könnte.