Re:Why I like Golang's interfaces
by Drup on Thursday April 13, 2017 @06:29PM
(#14111367)
Since the author likes both F# and structural typing, he might be interested in OCaml. F# took a lot of stuff from OCaml, but avoided both the object system and most of the module system, which both feature different flavor of structural typing.
In both case, as opposed to Go interfaces, they are actually safe (downcasting is forbidden, upcasting is checked at compile time) and
the OCaml language has very good type inference, type annotations are not needed.
In both case, as opposed to Go interfaces, they are actually safe (downcasting is forbidden, upcasting is checked at compile time) and the OCaml language has very good type inference, type annotations are not needed.