2 ms·
No open source code base I can point to right now unfortunately. But this is fun stuff, so I couldn't help creating a simple gist to demonstrate the concept: h
by sfvisser 4y ago
No open source code base I can point to right now unfortunately.
But this is fun stuff, so I couldn't help creating a simple gist to demonstrate the concept: https://gist.github.com/sebastiaanvisser/cd6ee46356e3ecc89457871ea3ce8cc2 https://gist.github.com/sebastiaanvisser/cd6ee46356e3ecc8945...
The trick is to keep all the combinators specific to your data type. In Haskell you can derive your functor (and applicative/foldable/traversable) and have a single cata to rule them all. In Rust you build them specifically for every datatype. Less neat, but could still be totally worth it!
- charleskinbote 4y agoThis is great, thanks for taking the time to flesh it out