In Haskell, map
has type:
map :: (a -> b) -> [a] -> [b]
Note that a
and b
are not absolute types but type variables, which mean that they can be any type as long as each variable always refer to the same type in a specific function call. How to do the same thing in Go?