Tag Archives: pattern matching

Adventures in Haskell – Pattern Matching

Simple Another nice feature of Haskell is pattern matching. I glossed over it in the Fibonacci function, so let’s review. fib :: (Integral t) => t -> t fib 0 = 1 fib 1 = 1 fib n = fib (n – 1) + fib (n – 2) Analogous code in Java would be: public […]