fmt-0.0.0.4: Nice formatting library

Safe HaskellNone
LanguageHaskell2010

Fmt.Internal

Contents

Description

A module providing access to internals (in case you really need them). Can change at any time, though probably won't.

Synopsis

Classes

class FromBuilder a where Source #

Minimal complete definition

fromBuilder

Methods

fromBuilder :: Builder -> a Source #

class FormatAsHex a where Source #

Minimal complete definition

hexF

Methods

hexF :: a -> Builder Source #

Format a number or bytestring as hex:

>>> hexF 3635
"e33"

class FormatAsBase64 a where Source #

Minimal complete definition

base64F, base64UrlF

Methods

base64F :: a -> Builder Source #

Convert a bytestring to base64:

>>> base64F ("\0\50\63\80" :: BS.ByteString)
"ADI/UA=="

base64UrlF :: a -> Builder Source #

Convert a bytestring to base64url (a variant of base64 which omits / and thus can be used in URLs):

>>> base64UrlF ("\0\50\63\80" :: BS.ByteString)
"ADI_UA=="

Helpers

groupInt :: (Buildable a, Integral a) => Int -> Char -> a -> Builder Source #

atBase :: Integral a => Int -> a -> String Source #

showSigned' :: Real a => (a -> ShowS) -> a -> ShowS Source #