Numerals in Positional Notation   [3]

Programming with powers

DESCRIPTION

-- inner product multiplies "vector" elements, then sums

ip  = sum . map (uncurry (*))

-- numl b converts from string in base b to integer

numl b = ip . zip pows . reverse . map val
         where pows = iterate (b*) 1

Notes