Introduction to Functional Programming. Haskell example