-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Human friendly conversion between byte units (KB, MB, GB...) -- -- Human friendly conversion between byte units (KB, MB, GB...)... @package byteunits @version 0.4.0 -- | Here is a quick example: -- --
-- ByteValue (1024 * 1024 * 3) -- -- the above will evaluate to: ByteValue 3145728.0 Bytes ---- --
-- getShortHand . getAppropriateUnits $ ByteValue (1024 * 1024 * 3) Bytes -- -- the above will evaluate to: "3.00 MB" --module Data.ByteUnits data ByteUnit Bytes :: ByteUnit KiloBytes :: ByteUnit MegaBytes :: ByteUnit GigaBytes :: ByteUnit TeraBytes :: ByteUnit PetaBytes :: ByteUnit ExaBytes :: ByteUnit data ByteValue ByteValue :: Float -> ByteUnit -> ByteValue -- | Also allows comparing sizes, but because it uses float - it might not -- be 100% accurate -- --
-- >>> ByteValue 1024 MegaBytes == ByteValue 1 GigaBytes -- False ---- --
-- >>> ByteValue 1023 MegaBytes < ByteValue 1 GigaBytes -- True ---- | Gets the value of bytes from a ByteValue type getBytes :: ByteValue -> Float -- | Converts the ByteValue to an ByteValue with the specified ByteUnit -- --
-- >>> convertByteUnit (ByteValue 500 GigaBytes) MegaBytes -- ByteValue 512000.0 MegaBytes --convertByteUnit :: ByteValue -> ByteUnit -> ByteValue -- | Converts to the largest unit size provided the float value is > 1 -- --
-- >>> getAppropriateUnits (ByteValue 1024 Bytes) -- ByteValue 1 KiloBytes ---- --
-- >>> getAppropriateUnits (ByteValue (3.5 * 1024* 1024) Bytes) -- ByteValue 3.5 MegaBytes --getAppropriateUnits :: ByteValue -> ByteValue -- | Converts to a short string representation -- --
-- >>> getShortHand $ ByteValue 100 MegaBytes -- "100.00 MB" --getShortHand :: ByteValue -> String instance GHC.Classes.Eq Data.ByteUnits.ByteValue instance GHC.Show.Show Data.ByteUnits.ByteValue instance GHC.Classes.Eq Data.ByteUnits.ByteUnit instance GHC.Show.Show Data.ByteUnits.ByteUnit instance GHC.Classes.Ord Data.ByteUnits.ByteValue