4 ms·
This is a really good question. When you write generic code in a language with higher-order functions, type signatures can get pretty hairy with type variables
by jasperry 3y ago
This is a really good question. When you write generic code in a language with higher-order functions, type signatures can get pretty hairy with type variables and quantifiers flying around (forall a. a -> foo a). In a functional language with type inference, it's mostly managing those for you, and you can (usually) just write code in a natural way and it automatically is polymorphic, but in a safer way than dynamically-typed languages.