Hacker News new | ask | show | jobs
by GeoJawDguJin 6049 days ago
No, the simplest case for Haskell would be type variables. For example, the map function doesn't need typeclasses at all:

map :: (a -> b) -> [a] -> [b]

For the record, in Go+generics, this might look something like:

func map<A,B>(f func (A) B, xs A[]) B[] { ... }

1 comments

Good point, I forgot that even simpler cases in Haskell are generic too.