Introduction to Functional ProgrammingThis is a thorough introduction to the fundamental concepts of functional programming.The book clearly expounds the construction of functional programming as a process of mathematical calculation, but restricts itself to the mathematics relevant to actual program construction. It covers simple and abstract datatypes, numbers, lists, examples, trees, and efficiency. It includes a simple, yet coherent treatment of the Haskell class; a calculus of time complexity; and new coverage of monadic input-output. |
From inside the book
Results 1-3 of 29
Page 67
... foldl , the other flavour of the fold operator . Informally , it is defined by : foldl ( ) a [ 1 , 2 ,. • • • , £ n ] = ( · · · ( ( a ℗ x1 ) ® X2 ) ... · ) D Xn In particular , we have : foldl ( 0 ) a [ ] foldl ( ) a [ 1 ] foldl ( ) a ...
... foldl , the other flavour of the fold operator . Informally , it is defined by : foldl ( ) a [ 1 , 2 ,. • • • , £ n ] = ( · · · ( ( a ℗ x1 ) ® X2 ) ... · ) D Xn In particular , we have : foldl ( 0 ) a [ ] foldl ( ) a [ 1 ] foldl ( ) a ...
Page 125
... foldl ( ☺ ) y xs = foldl ( ® ) ( x − y ) xs for every x and y and every finite list zs . We will first prove the auxiliary result , and then prove the main result . The auxiliary is proved by induction on rs . Case [ ] . We have : x ...
... foldl ( ☺ ) y xs = foldl ( ® ) ( x − y ) xs for every x and y and every finite list zs . We will first prove the auxiliary result , and then prove the main result . The auxiliary is proved by induction on rs . Case [ ] . We have : x ...
Page 150
... ( foldl ( → ) ) , and hence also equivalent to foldl ' ( ) . It follows that replacing foldl by foldl ' in the definition of sum is valid , and the same replacement is valid whenever foldl is applied to a binary operation that is strict ...
... ( foldl ( → ) ) , and hence also equivalent to foldl ' ( ) . It follows that replacing foldl by foldl ' in the definition of sum is valid , and the same replacement is valid whenever foldl is applied to a binary operation that is strict ...
Common terms and phrases
abstr aexp algorithm apply argument arithmetic bigit binary search trees binary tree bool btree Chapter char characters compute concat concatenation consider curry define a function delete denotes dropwhile efficient Eight Queens problem element empty equation evaluation example Exercises expression False filter finite foldl foldr Functional composition functional programming given graph reduction implementation induction infinite list init insert insertion sort integers iterate labels t2 length lines list comprehension list zs lookup map f mapbtree mathematical merge sort minimax mkarray natural numbers Node non-empty list notation operations otherwise outermost reduction pair position problem proof prove queens quicksort recursive definition reduction steps representation represented result returns reverse xs sequence sneeuq solution square string structural induction subtree Succ Suppose synthesise take n xs takewhile True unlines variable words write xs ys Zero