-- Computes the factorial of a non-negative number. ffac :: Int -> Int fac n = if n==0 then 1 else n * fac (n-1) --last xs | xs == _ ++ [e] = e where e free -- Functional pattern: last (_ ++ [e]) = e -- Permutation of a list: perm :: [a] -> [a] perm [] = [] perm (xs ++ [x] ++ ys) = x : perm (xs++ys)