by pillowkusis · 9y ago · 0 comments
Kotlin has somewhat pattern matching: https://kotlinlang.org/docs/reference/control-flow.html#when...
Tail call optimization: https://kotlinlang.org/docs/reference/functions.html#tail-re...
Type classes: https://kotlinlang.org/docs/reference/sealed-classes.html
And I'm not sure what you mean by recursive data structures. Basically every C style language I'm aware of can contain a reference to another instance of its own type.
It's more java-y than Scala, but it's fundementally capable of a very FP style.
Those are not type-classes, at least not in the Haskell sense. They allow you to avoid an else branch, yes, which is actually quite useful; but one basic ability they're missing is the ability to define a new branch for a new instance of the type defined by library users.
Just as an example. They're really not much like type-classes at all.
Sealed classes are an odd/wonky take on sum types, they're not even remotely close to type classes.