4 ms·
You don't need to understand category theory to understand Cofree. It's not a very complicated construction. The Haskell ecosystem's provision of stuff like Fre
by wyager 9y ago
You don't need to understand category theory to understand Cofree. It's not a very complicated construction. The Haskell ecosystem's provision of stuff like Free, Cofree, Fix, etc. covers a huge number of common constructions and saves you a lot of effort.
A common example of a "kind of hard problem" I see all the time on various tech sites (e.g. here) is flattening a rose tree (arbitrary depth nested array). Guess what? In Haskell, you can express the whole structure as "Free []". Hundreds of useful primitives are already written for you, including the thing you need to flatten the tree, "toList". This just goes to show that it's not a pointless masturbatory excercise in dragging math into software engineering; it's actually directly and immediately very useful.
- reikonomusha 9y agoSomeone not understanding how to flatten a tree (or what have you) to having to understand Free is a huge jump.