Hacker News new | ask | show | jobs
by crote 32 days ago
> class Semigroup a => Monoid

Yes, hence the "at least a few years ago". But perhaps I'm misremembering and confusing it with applicative functors, it has been a few years.

> I guess they went with a non-breaking feature introduction.

Sure, but functors aren't exactly novel, are they? Although it has contributed a lot to programming language design in general, Haskell didn't exactly invent the concept of a generic "map". So why wasn't it there in the first place, and why was it - despite its obvious prominence - not deemed important enough for a (what seems to be tiny) breaking change?

> Anyway, it could be worse. You could be working in a language that can't even express the functor/map interface.

Are those still around? I thought even Go eventually started supporting generics?

1 comments

"Generics" doesn't cut it. Most languages just can't functor.

Go - no. https://www.reddit.com/r/golang/comments/v1ljep/monads_and_p...

Swift - no. https://forums.swift.org/t/higher-kinded-types-monads-functo...

Rust - no. https://www.reddit.com/r/rust/comments/152bgj0/current_state...

"Awkward fmap" and "random collection of category theory concepts thrown together in a weekend" is great compared to the alternatives.