Re:Show HN: Bon – programming language designed for simplici...
by perfunctory on Wednesday January 23, 2019 @04:00AM
(#18976773)
This seems to be straight from Haskell. `class` here doesn't mean what it means in oop languages.
[ Parent
| on HN ]
Re:Show HN: Bon – programming language designed for simplici...
by FBMachine on Wednesday January 23, 2019 @07:19PM
(#18984718)
Yeah, 'class' in Bon defines a typeclass. While I plan on adding x.norm() as syntactic sugar for norm(x), typeclasses in general are a bit more flexible. For example, while you can use it for polymorphic operator overloading [0], you can also overload a function by changing the types of multiple parameters [1] (as in multiple dispatch).
[0] https://github.com/FBMachine/bon/blob/master/examples/equali...
[1] https://github.com/FBMachine/bon/blob/master/examples/multip...