A realization today while working on my http://scala.one course: Scala's type system has one feature which imposes a sort-level constraint (values -> types -> kinds -> sorts): context bounds. The kind on the RHS of the colon is dependent on the kind on the LHS.
-
-
In the syntactic form T : U, both T and U represent type trees. If T has kind k, then U has to have kind k → *. Your assessment seems accurate.
-
As opposed to Haskell, the colon here is not a first-class construct that can appear in an arbitrary position. In Haskell, the kind of (:) would be k → (k → Constraint) → Constraint, probably.
End of conversation
New conversation -
-
-
It’s a kind-polymorphic construct, but there are no sorts involved higher than kinds.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.