si-bytes-0.1: Byte with type-level units (e.g. B, KB, MB, ...).
Safe HaskellNone
LanguageHaskell2010

Data.Bytes.Formatting.Size

Description

Provides formatters for Size.

Since: 0.1

Synopsis

Documentation

data SizeFormat Source #

Determines how to format the size units.

Examples

Expand
>>> def @SizeFormat
SizeFormatMedium

Since: 0.1

Constructors

SizeFormatShort

Since: 0.1

SizeFormatMedium

Since: 0.1

SizeFormatLong

Since: 0.1

Instances

Instances details
Show SizeFormat Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

Default SizeFormat Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

Eq SizeFormat Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

data SizedFormatter Source #

Formatting size units.

Examples

Expand
>>> def @SizedFormatter
MkSizedFormatter {caseFormat = CaseFormatLower, leadingSpace = True, sizeFormat = SizeFormatMedium}

Since: 0.1

Instances

Instances details
Show SizedFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

Default SizedFormatter Source # 
Instance details

Defined in Data.Bytes.Formatting.Size

Eq SizedFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

Formatter SizedFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

(k ~ A_Lens, a ~ CaseFormat, b ~ CaseFormat) => LabelOptic "caseFormat" k SizedFormatter SizedFormatter a b Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

(k ~ A_Lens, a ~ Bool, b ~ Bool) => LabelOptic "leadingSpace" k SizedFormatter SizedFormatter a b Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

(k ~ A_Lens, a ~ SizeFormat, b ~ SizeFormat) => LabelOptic "sizeFormat" k SizedFormatter SizedFormatter a b Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

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