, GHC (, fromIntegral), .
GHC.Real,
-- | general coercion from integral types
fromIntegral :: (Integral a, Num b) => a -> b
fromIntegral = fromInteger . toInteger
{-
"fromIntegral/Int->Int" fromIntegral = id :: Int -> Int
, , , , , .
, GHC.Int, , . (, realToFrac).
, . . - (, Integer GHC) . (, fromIntegral), , .
- - :
instance PixelComponent CUChar where
blackWhite x = (minBound x, maxBound x)
toInt = id
toRealFrac = fromIntegral
{-# INLINE fromComponent #-}
fromComponent = toCUChar
toCUChar :: PixelComponent a => a -> CUChar
toCUChar = ...
{-# RULES "fromComponent/CUChar->CUChar" toCUChar = id :: CUChar -> CUChar #-}
- , GHC, , , . , .