Abusing Laziness and HO

The following two examples (ab)use Haskell’s laziness and higher order features to allow concise functions of recursive functions.

> module HigherOrder where
> import Data.List (nubBy)
> primes :: [Int] 
> primes = nubBy (((>1).).gcd) [2..]
> fibs :: [Int] 
> fibs = 0:1:(zipWith (+) fibs (tail fibs))