3 ms·
Noon question: what is a typeclass in the sense of the feature Elm lacks? Does it mean the equivalent to `class` keyword in the OO sense?
by yomly 9y ago
Noon question: what is a typeclass in the sense of the feature Elm lacks?
Does it mean the equivalent to `class` keyword in the OO sense?
- hawkice 9y agoFrom an OO perspective, Elm lacks interfaces. Typeclasses are probably the best way to handle the idea of interfaces in the functional programming model. Since functions are first class, you can bodge this with an object that has functions in it, but since those don't serialize they don't play well with a lot of Elm idioms if you put them in your model.
- a-saleh 9y agoI thought about this, and kinda came to a conclusion, than I would take a language that has generics, and doesn't have interfaces (i.e. Elm) over a language that has interfaces and doesn't have generics (i.e. Go)