Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Java terms, a "type constructor" would be a generic class like, say, `ArrayList<T>`.

A constructor can be viewed as a function that takes values for the fields of a datatype and gives a value of the datatype in return. Not all functions are constructors, but some are.

At the type level, if we squint a little, "Maybe" or "List" behave a bit like constructors. They take types like "Int" or "Bool" as parameters, and give types like "Maybe Int" and "List Bool" in return. Not all type-level "functions" are type constructors (for example, in Haskell type families are not type constructors) but some are.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: