I forgot where I read this, but I'll paraphrase: it's easier to work with 10 objects with 1000 applicable functions than with 1000 objects with 10 methods each.
In Haskell or other typed fp languages, you have all these well-recognized and well-used typeclasses and their attached methods, conceptually equivalent to generic interfaces in c#/java. It's easier to adapt new data structures into these interfaces and have all your existing functions immediately work with them.
The "mathematics" part here is that these typeclasses are backed by category theory that prescribes their behaviors.
There are plenty of random readings you can find, so I won't recommend them. Someone's bound to argue with me on what's a better entrypoint.
I do want to note that you don't need to use haskell or an fp language to use these concepts. Example: a complete set of fp data structures in typescript https://gcanti.github.io/fp-ts/modules/. It's just that fp languages make using them much easier because of their type system.
> The list, Lisp's native data structure, is largely responsible for such growth of utility. The simple structure and natural applicability of lists are reflected in functions that are amazingly nonidiosyncratic. In Pascal the plethora of declarable data structures induces a specialization within functions that inhibits and penalizes casual cooperation. It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures. As a result the pyramid must stand unchanged for a millennium; the organism must evolve or perish.
I love programming with typeclasses based on mathematical abstractions. I guess it's because they actually have a chance of standing unchanged for a millennium.
In Haskell or other typed fp languages, you have all these well-recognized and well-used typeclasses and their attached methods, conceptually equivalent to generic interfaces in c#/java. It's easier to adapt new data structures into these interfaces and have all your existing functions immediately work with them.
The "mathematics" part here is that these typeclasses are backed by category theory that prescribes their behaviors.
There are plenty of random readings you can find, so I won't recommend them. Someone's bound to argue with me on what's a better entrypoint.
I do want to note that you don't need to use haskell or an fp language to use these concepts. Example: a complete set of fp data structures in typescript https://gcanti.github.io/fp-ts/modules/. It's just that fp languages make using them much easier because of their type system.