C.11 Thematic Takeaways
While a goal of the functional style of programming is to bring programming closer to mathematics, Haskell and its syntax, as well as the responses of the Haskell interpreter (particularly for tuples and functions), make the connection between functional programming and mathematics salient.
Native support for pattern-directed invocation is one of the most convenient features of user-defined functions in Haskell because it obviates the need for an if–then–else expression to differentiate between the various inputs to a function.
Use of pattern-directed invocation (i.e., pattern matching) introduces declarative programming into Haskell.
Pattern-directed invocation is not operator/function overloading.
Operator/function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access