Search code examples
language-agnostictypeslanguage-designabstractionfirst-class

What are the benefits of types being first-class objects?


Does anybody here have good examples where types as first-class objects come in hand?

I guess it helps to straightforwardly implement some math concepts, indeed that is the kind of examples I'm looking for.

UPD To clarify the question, what can be done if one can make functions accepting types and returning types, or store types in variables?

I'm studying Aldor, though due to license issue it is a bit dead. There types are said to be first-class objects, at least in the sence above.


Solution

  • Take a look at Agda2, ats-lang.org and other languages with dependent types. Not quite what you asked, but related.