-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Soar with Haskell
By :

This chapter has explained to us how to define and use algebraic datatypes, with pattern matching as a notable concept for taking values apart. First, we have seen the restricted forms of enumeration types and record types. Next, we have seen how these can be in their more general form by combining features of the two. We have also introduced parametric polymorphism, a powerful mechanism for abstracting over types, that can be used in function signatures and in the definition of algebraic datatypes.
In Chapter 3, Recursion, we will learn about recursive definitions, which can be used for both functions and datatypes. Recursive function definitions are the counterpart of imperative loops and enable (both bounded and unbounded) repetition of computation. Recursive datatype definitions enable data structures of arbitrary size and are typically processed by recursive functions.