-- a lib to help make your constants (portably) module ToBase where import Prelude --numerical, tuple, list stuff only default () --(Recommend to use Integer instances so we can run on any machine -- ... nah, instead I required Integer for where it's important.) --'b' will get only real integral values --whose absolute values are less than base (which must --be positive greater than 1), but it technically could --Double, Rational, Complex... toBase :: (Num b) => Integer -> Integer -> [b] toBase base | base > 1 = go where go n = if n == 0 then [] else fromIntegral r : go q where (q,r) = n `quotRem` base