3 ms·
Regarding your note "0", could anybody here explain how the Y combinator be properly typed in a more advanced type system? Is there a (practical) language that
by amelius 12y ago
Regarding your note "0", could anybody here explain how the Y combinator be properly typed in a more advanced type system? Is there a (practical) language that would allow it to be typed?
Also, would the Y combinator be a useful abstraction-aid in a compiler (for a typed language), or does it exist merely as a curiosity?
- klibertp 12y agoTake a look at these examples: http://rosettacode.org/wiki/Y_combinator#Haskell http://rosettacode.org/wiki/Y_combinator#OCaml http://rosettacode.org/wiki/Y_combinator#Scala http://rosettacode.org/wiki/Y_combinator#Standard_ML http://rosettacode.org/wiki/Y_combinator#Swift The Mu/Roll trick seems to be a default way of typing Y, while some languages (like OCaml) provide other type-system features like recursive types or polymorphic variants.