[Haskell-beginners] A Key Part of Functional Programming
Costello, Roger L.
costello at mitre.org
Fri Dec 21 11:21:08 CET 2012
Hi Folks,
Richard Bird write on page 91 of his book, "Introduction to Functional Programming using Haskell":
The datatype of lists is the workhorse
of functional programming.
Notice that he does not say that lists are the workhorse of "Haskell." No. He makes a much broader statement. Lists are the workhorse of Haskell and Lisp and Miranda and all the functional languages. Lists are a key part of functional languages.
On page 95 he defines the list concatenation operator:
(++) :: [a] -> [a] -> [a]
[] ++ ys = ys
(x:xs) ++ ys = x : (xs ++ ys)
Then on page 96 he states:
Once one has come to grips with the definition of ++,
one has understood a good deal about how lists work
in functional languages.
Again notice that he does not say that by coming to grips with the definition of ++ one will have a good understanding of how lists work in "Haskell." No. He makes a much broader statement. One will have a good understanding of how lists work in all functional languages. Although the syntax may change, this definition of concatenation is for all functional languages.
Wow! That is so cool.
/Roger
More information about the Beginners
mailing list