Yes, that's what I meant. This is very different from having to extend Foldable to achieve the same thing.
ah sorry, i was skimming and misread your comment as
> The Haskellite approach that says "what operations are available on that thing" is the wrong way round
which left me pretty confused!
> The Haskellite approach would also say that "what operations are available on that thing" is the wrong way round; you define your operation, and the type signature tells you what kind of things will work with it.
i'm not sure if i understand. using typeclasses i can define a Haskell function for summing collections:
and it'll work for any Foldable collection (supporting `reduce`) of Monoidal values (supporting "addition", or the `<>` operator) - lists of strings, trees of ints, etc. that sounds a lot like "define your operation, and the type signature tells you what kind of things will work with it"