I wasn’t too fond of this article for a few reasons:
The opening example with Codec isn’t a monoid and doesn’t have anything to do with the rest of the blog. Also, you don’t need an ABC or decode to elegantly serialize objects to bytes. That’s what the __bytes__ method is for!
The post is all about how efficient monoids and thunks are but that’s only true if you have an FP-first language! If you wanna make Python fast you gotta use imperative code. A simple while-loop factorial was ten times faster than the thunked version on my computer.
They never explained why the thunk variable needed to be covariant.
I wasn’t too fond of this article for a few reasons:
Codec
isn’t a monoid and doesn’t have anything to do with the rest of the blog. Also, you don’t need an ABC ordecode
to elegantly serialize objects to bytes. That’s what the__bytes__
method is for!Great criticisms!
Really enjoyed this article. Also the title. Big fan.