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

Data.Bytes.Formatting.Base

Description

Provides types for abstracting over formatters.

Since: 0.1

Synopsis

Abstracting over formatters

class Formatter a where Source #

Maps the formatter to its format string.

Since: 0.1

Methods

formatStr :: a -> Text Source #

Instances

Instances details
Formatter FloatingFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base

Formatter IntegralFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base

Formatter DirectedFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Direction

Formatter SizedFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Size

data IntegralFormatter Source #

Formatter for integral types.

Since: 0.1

Constructors

MkIntegralFormatter 

Instances

Instances details
Formatter IntegralFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base

newtype FloatingFormatter Source #

Formatter for floating types. Takes an optional param for rounding digits.

Since: 0.1

Instances

Instances details
Formatter FloatingFormatter Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base

type family BaseFormatter a Source #

Relates a "base" value with its given formatter. This is used to enforce type-safe formatting e.g. floating types can only be used with FloatingFormatter.

Since: 0.1

Instances

Instances details
type BaseFormatter Int16 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Int32 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Int64 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Int8 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Word16 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Word32 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Word64 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Word8 Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Integer Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Natural Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Double Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Float Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Int Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

type BaseFormatter Word Source # 
Instance details

Defined in Data.Bytes.Formatting.Base

formatBase :: (BaseFormatter a ~ f, Formatter f, PrintfArg a) => f -> a -> Text Source #

Formats a value to a string. BaseFormatter is used to enforce type-safety.

Since: 0.1

Common formatting types

data CaseFormat Source #

Case formatting.

Since: 0.1

Constructors

CaseFormatLower

Since: 0.1

CaseFormatTitle

Since: 0.1

CaseFormatUpper

Since: 0.1

Instances

Instances details
Show CaseFormat Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base

Eq CaseFormat Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Formatting.Base