-- Examples.hs
-- CompSci 141 / CSE 141 / Informatics 101 Spring 2013
-- Project #3 example

-- The "module" directive gives a name to a set of definitions in a Haskell
-- script.  It's actually part of a group of language features that support
-- the organization of large programs into "modules," with importing and
-- exporting facilities that provide the kind of information hiding used to
-- build abstract data types.  For our purposes, we'll use it to give a name
-- to each script, so that you'll know, within the interpreter, which script
-- you're currently working with.

module Examples where


factorial :: Integer -> Integer
factorial 0     = 1
factorial n
   | n > 0      = n * factorial (n - 1)


listLength :: [Integer] -> Integer
listLength []     = 0
listLength (x:xs) = 1 + listLength xs
