Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides formatters for Size
.
Since: 0.1
Synopsis
- data SizeFormat
- _SizeFormatShort :: Prism' SizeFormat ()
- _SizeFormatMedium :: Prism' SizeFormat ()
- _SizeFormatLong :: Prism' SizeFormat ()
- data SizedFormatter = MkSizedFormatter {}
- formatSize :: Sized a => SizedFormatter -> a -> Text
- sizedFormatterUnix :: SizedFormatter
- sizedFormatterNatural :: SizedFormatter
- sizedFormatterVerbose :: SizedFormatter
Documentation
data SizeFormat Source #
Determines how to format the size units.
Examples
>>>
def @SizeFormat
SizeFormatMedium
Since: 0.1
SizeFormatShort | Since: 0.1 |
SizeFormatMedium | Since: 0.1 |
SizeFormatLong | Since: 0.1 |
Instances
Default SizeFormat Source # | Since: 0.1 |
Defined in Data.Bytes.Formatting.Size def :: SizeFormat Source # | |
Show SizeFormat Source # | Since: 0.1 |
Defined in Data.Bytes.Formatting.Size showsPrec :: Int -> SizeFormat -> ShowS # show :: SizeFormat -> String # showList :: [SizeFormat] -> ShowS # | |
Eq SizeFormat Source # | Since: 0.1 |
Defined in Data.Bytes.Formatting.Size (==) :: SizeFormat -> SizeFormat -> Bool # (/=) :: SizeFormat -> SizeFormat -> Bool # |
_SizeFormatShort :: Prism' SizeFormat () Source #
Since: 0.1
_SizeFormatMedium :: Prism' SizeFormat () Source #
Since: 0.1
_SizeFormatLong :: Prism' SizeFormat () Source #
Since: 0.1
data SizedFormatter Source #
Formatting size units.
Examples
>>>
def @SizedFormatter
MkSizedFormatter {caseFormat = CaseFormatLower, leadingSpace = True, sizeFormat = SizeFormatMedium}
Since: 0.1
Instances
formatSize :: Sized a => SizedFormatter -> a -> Text Source #
Formats size units.
Since: 0.1
sizedFormatterUnix :: SizedFormatter Source #
Unix-style formatter:
- Upper case.
- No space between value and unit.
- Single letter unit.
For example: 7G
.
Since: 0.1
sizedFormatterNatural :: SizedFormatter Source #
Natural-style formatter:
- Lower case.
- Space between value and unit.
- Two letter units.
For example: 7 gb
.
Since: 0.1
sizedFormatterVerbose :: SizedFormatter Source #
Verbose formatter:
- Lower case.
- Space between value and unit.
- Full spelling.
For example: 7 gigabytes
.
Since: 0.1