A while back, I started work on a NullRecord gem trying to implement an option for ActiveRecord models with an interface along the lines of
with_null_record :name_of_null_object
and providing a initializer to act as a registry for these. I then discovered Advi Grimm’s Naught and that kind of made cool off. I’ll probably give it a go as an exercise when I have some downtime.
I would give you some advice, if that is okay.
First off, look at Advi’s gem for inspiration, it is quite interesting.
Second, I wouldn’t conflate functors/monads and null objects. I would split them in to two gems and make my best to enable their interfaces to be compatible.
Also, sharing a link to a repo will get people looking at your code and helping out I am aware this is one of those “here is some advice I am not actually taking myself” moments…)
Hey @pedromoreira! Thanks for your advice! I already edited my post to provide a link to my repo, and I just started to look at Advi’s gem, thanks for mentioning it! Really appreciate your help!