Closed FPtje closed 1 year ago
Thanks everyone for the review! Let's merge!
@OpsBotPrime merge
Pull request approved for merge by @FPtje, rebasing now.
Rebased as fc89ccd788334f2c56212d4ef3d4e9fe1acc845c, waiting for CI …
CI job :yellow_circle: started.
Description
This (somewhat large) PR rewrites Hoff from using effects to using effectful. This is mostly an exercise for me to personally get familiar with the library, but I think it's worth considering a merge.
Why prefer
effectful
over free monads?Hoff uses Free monads quite well, which makes it a perfect example for comparison against
effectful
. In that comparison, I thinkeffectful
comes out on top:Sum
tree structure to combine different effectscont
s in the code was very satisfyingeffectful
implementation only has 30 more lines in total. In some placeseffectful
is more boilerplate, in other placesfree
has more.Why rewrite?
Under normal circumstances, I would argue quite strongly that rewriting is a bad idea. In this case, this is a Hobby project, one that I would also like to use to advocate for the
effectful
library, and to teach the differences betweenfree
andeffectful
. The really nice thing here is that this is a PR where the left side shows all the implementation specifics offree
, and the right side shows that ofeffectful
.For this purpose I will also write a bunch of review comments. This documents the differences, and also makes the job of a reviewer easier.
Testing
This PR has been tested as follows:
tools/
to merge a PR in agit-sandbox
repositorySince semantics didn't change, and above tests passed the first try, I'm confident this PR will not negatively affect Hoff's performance.