Re:What Golang Is and Is Not
by chrismonsanto on Sunday August 21, 2016 @09:54PM
(#12333657)
To be precise, you need to outlaw polymorphic recursion to be able to do full monomorphisation. I'm not sure if that's what you meant by "second-class" in this context
[ Parent
| on HN ]
First-class polymorphism is what System F gives you: functions from types to values.
Second-class polymorphism is what Damas-Milner gives you: let-bound identifiers may admit more than one type, in which case every type they admit is subsumed by a type schema.
Second-class polymorphism rules out polymorphic recursion if you consider every recursive definition as syntactic sugar for applying a fixed point combinator to some expression of type `a -> a`, for whatever monotype `a`.
Re:What Golang Is and Is Not
by chrismonsanto on Sunday August 21, 2016 @10:01PM
(#12333679)
That's a new turn of the phrase for me. I've only ever heard the expression "second-class parametric polymorphism" used in reference to enforcing predicativity (which does not rule out polymorphic recursion)