shithub: MicroHs

ref: 11de082b61546dbd5b02bb2a5d3a389a9a716ec5
dir: /ghc/Data/Integer.hs/

View raw version
module Data.Integer(_integerToIntList) where

-- Same as in Data.Integer
_integerToIntList :: Integer -> [Int]
_integerToIntList i | i < 0 = -1 : to (-i)
                    | otherwise =  to i
  where to 0 = []
        to n = fromInteger r : to q  where (q, r) = quotRem n 2147483648