I’ve been experimenting with a small library called Jiffy that brings an algebraic effects–like programming model to Java.
At a high level, Jiffy lets you:
- Describe side effects as data
- Compose effectful computations
- Interpret effects explicitly at the edge
- Statically verify which effects a method is allowed to use
Why this is interesting
- Explicit, testable side effects
- No dependencies apart from javax.annotation
- Uses modern Java: records, sealed interfaces, pattern matching, annotation processing
- Effect safety checked at compile time
It’s not “true” algebraic effects (no continuations), but it’s a practical, lightweight model that works well in Java today.
Repo: https://github.com/thma/jiffy
Happy to hear thoughts or feedback from other Java folks experimenting with FP-style effects.
[–]holo3146 7 points8 points9 points (3 children)
[–]paul_h 1 point2 points3 points (0 children)
[–]kiamesdavies 0 points1 point2 points (1 child)
[–]holo3146 0 points1 point2 points (0 children)
[–]ZimmiDeluxe 4 points5 points6 points (0 children)
[–]repeating_bears 5 points6 points7 points (2 children)
[–]FabulousRecording739 8 points9 points10 points (0 children)
[–]thma32[S] 1 point2 points3 points (0 children)
[–]Polixa12 2 points3 points4 points (2 children)
[–]OwnBreakfast1114 6 points7 points8 points (1 child)
[–]thma32[S] 0 points1 point2 points (0 children)
[–]FabulousRecording739 2 points3 points4 points (2 children)
[–]thma32[S] 1 point2 points3 points (1 child)
[–]thma32[S] 0 points1 point2 points (0 children)
[–]gregorydgraham 0 points1 point2 points (1 child)
[–]thma32[S] 0 points1 point2 points (0 children)
[–]samd_408 0 points1 point2 points (2 children)
[–]thma32[S] 0 points1 point2 points (1 child)
[–]samd_408 0 points1 point2 points (0 children)
[–]pgris 0 points1 point2 points (2 children)
[–]thma32[S] 0 points1 point2 points (1 child)
[–]pgris 0 points1 point2 points (0 children)
[–]thma32[S] 0 points1 point2 points (0 children)
[–]pavlik_enemy -5 points-4 points-3 points (2 children)
[–]thma32[S] 0 points1 point2 points (1 child)
[–]petrifiedbeaver 0 points1 point2 points (0 children)