--powers n : the list of powers of n -- Int -> [Int] powers=\n->powp n n --powp n e : the list of powers of e, multiplied by n# -- Int -> Int -> [Int] powp=\n ->\e-> n:(powp (n*e) (e)) --factorals : the list of factorials -- [Int] factorials= facp 1 2 --facp n x : the list of numbers of n, multiplied by each number -- starting from x -- Int -> Int -> [Int] facp=\n-> \x -> n:(facp (n*x) (x+1)) --runs ns : the number of block of items in ns# -- [Int] -> Int runs=\ns-> runp ns 0 --runp ns cur acc : the number of adjacent blocks in ns, plus acc -- [Int] -> Int -> Int runp=\ns->\acc-> if ns ==[] then acc else if tail ns == [] then acc+1 else runp (tail ns) (acc+(if head ns /=head(tail ns) then 1 else 0))