shithub: MicroHs

ref: cc5f799ee6b51ce2859a74dbcd36b484d805732c
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