4 ms·
So, I’ve programmed in Haskell and Clojure and I really wish people would give over on the Haskell requires category theory meme. What Haskell offers is _gener
by stcredzero 8y ago
So, I’ve programmed in Haskell and Clojure and I really wish people would give over on the Haskell requires category theory meme.
What Haskell offers is _generalisation of abstraction_. So, the function that satisfies the behaviour of fnil is called fmap, but it’s also the function that maps a function over all the values of a list, or the return values of a function. Equally, the equivalent of some->> (do notation) works for all of the above and more.
None of this requires you to know what a Kliesi category is.
These three paragraphs are unintentionally enigmatic and emblematic! Literally, the only thing I understood in the 2nd and 3rd paragraphs was, "What Haskell offers is generalization of abstraction." It's as if some large fraction of the Haskell community is significantly lacking self-awareness of how its own PR comes across. Been there and done that, just with Objects.
EDIT: Which is to say, A community that engages in such lack of self-awareness is dooming itself to hipster obscurity.
- hnzix 8y ago“A Monad is just a monoid in the category of endofunctors, what’s the big deal?”
- moomin 8y agoOkay, let’s make concrete what I said about fmap. Let’s say we have a function addOne. Then > fmap addOne Nothing Nothing > fmap addOne (Just 2) Just 3 > fmap addOne [1,2,3] [2,3,4] > fmap addOne parseInt (A function that reads a string for an int and adds one to the result.) So fmap is polymorphic over a whole bunch of things that are unrelated in most other languages. (You might be asking why it’s called fmap and not map, and I wouldn’t have a good answer for you.) So, the abstractions of “Nullable, List and Function Return Value” are all part of a more general abstraction, Functor. Now, at this point some people try to look up what a category theoretic definition of a Functor is. That’s fine, more power to their elbow. However, really all a Functor is in a practical sense for a dumb programmer like me is _something that supports fmap_. My point is, it’s this stuff that’s useful and cool in Haskell. It won’t help you understand whatever they’re talking about on r/Haskell. And my only point about Kliesi categories is that you don’t need to know what they are. There’s a million and one interesting computer science concepts that are usable with a type system with Haskell’s properties, but you don’t have to use them all.
- stcredzero 8y agoThanks. However your comment is still unintentionally enigmatic and emblematic!
- moomin 8y agoNone of us are perfect. :)
- stcredzero 8y agoIt's the coding scenes that do a good job on PR that win. "Amateurs study tactics, while professionals study logistics." -- I think there's something analogous with programming languages and ecosystems/communities.