3 ms·
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 th
by GeoJawDguJin 17y 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[] { ... }
- mbrubeck 17y agoGood point, I forgot that even simpler cases in Haskell are generic too.