[Added skeletons for ch0[123] John Goerzen **20070620231348] { hunk ./en/00book.xml 9 + + + hunk ./en/00book.xml 82 + &ch01; + &ch02; + &ch03; hunk ./en/book-shortcuts.xml 25 +let"> +where"> +if"> +case"> + addfile ./en/ch01-whyfp.xml hunk ./en/ch01-whyfp.xml 1 + + + + Why Functional Programming? Why Haskell? + FIXME + FIXME: goals of this book. The emphasis will be practical: on + using FP and Haskell to design, write, and fix real programs. The + audience is people who can already program. There will be plenty of + examples and exercises. + + + + The Nature of Functional Programming + FIXME + + + + Features of Haskell + FIXME + FIXME: roots in research + FIXME: perception that it's not practical; this book will + refute + + + + Strong Typing & Type Inference + FIXME + + + + Laziness + FIXME + + + + Compiled or Interpreted + FIXME + + + + + Purity + FIXME + + + + Modularity + FIXME + + + + Expressiveness + FIXME + + + + Composability + FIXME + + + + Robustness & Correctness + FIXME + + + + + + Things Haskell Doesn't Have (Or Need) + + + Looping with <literal>for</literal> or + <literal>while</literal> + FIXME + + + + Mutable Variables + FIXME + + + + + Haskell Environment + FIXME: + Mention the Haskell environment that the book assumes (GHC 6.6+). + Describe how to obtain and install it. Refer to alternative Haskell + implementations (Hugs), but leave any detail to an appendix. + + + + + Helpful Resources + FIXME: + Provide pointers to long-lived web sites, mailing lists, and IRC + channels for help and social interaction with other Haskell people. + + + + + addfile ./en/ch02-starting.xml hunk ./en/ch02-starting.xml 1 + + + + Getting Started + + + Installing GHC + FIXME: How to download and install GHC for Windows, OS X, and Linux. Not + much detail, since details bitrot fast. + + + + + Using &ghci; + FIXME: How to run ghci, the Haskell interpreter, and evaluate simple + expressions. Introduce a few simple built-in data types: numbers, + lists, strings. + + + + + Haskell Programs: Source Files & Functions + FIXME: What Haskell source files look like. How to write a simple + function. Hey, functions look different from traditional languages! + How to get ghci to load the source file; using the definitions from + it. + + + + + Types + FIXME: + Introduce types. Use ghci to inspect the types of a few values and + functions. Describe what the "->" means. Note the difference in + case between the first character of types and functions/values. + Take the type information ghci gave us; put it in the source file; + reload. Notice that ghci is still happy. + + + + + + addfile ./en/ch03-funcs-types.xml hunk ./en/ch03-funcs-types.xml 1 + + + + Types and Functions + + + Strong & Static Typing With Inference + FIXME + See also . + + + + Pattern Matching + + FIXME: + Introduce pattern matching. Show how to write a function as a + series of clauses, each predicated on its patterns. + + + + + Basic Types + FIXME: + Type basics: products (tuples), sums (Maybe,Either), recursive types + (lists). Give us enough glue to pattern match on. + + + + + Guards + FIXME: Introduce guards. Show that guards and patterns can be used + together or independently. + + + + + Conditionals: &if; and &case; + FIXME + + + + Local definitions: &let; and &where; + FIXME + + + + Example: Run-Length Encoding + FIXME: Example: run-length encoding. Use to show how looping can be done + via tail recursion. + + + + + Infix Functions + FIXME: Infix functions. Using and defining them, and infix use of normal + functions. + + + + + Type Inference + FIXME: + Discuss type inference: what it is and how it can save a lot of work. + + + + + Typeclasses + FIXME: + Introduce type classes. Show how ghci infers types with + constraints. Define some functions that use type class + constraints. Talk about when it's appropriate to write explicit + signatures. + + See also . + + + + Example: Data.Map API + FIXME: + Small example would be a finite map data structure API, with a list + and tree implementation (different complexity, same api). Ties + together basic types, small functions, top level functions. + + class Map m where + new :: m k v + insert :: k -> v -> m k v -> m k v + lookup :: k -> m k v -> v + + -- simple, O(n) + + data Map1 k v = [(k,v)] + + -- less simple, O(log n) + + data Map2 k v = Node k v (Map2 k v) (Map2 k v) + | Empty + + + + + + }