bottom-0.1.0.0: Encoding and decoding for the Bottom spec.
Safe HaskellNone
LanguageHaskell2010

Data.Encoding.Bottom

Description

Encodes and decodes Texts to Bottoms. For details, see the Bottom spec.

Synopsis

Documentation

data Bottom Source #

A Bottom is a wrapper around well-formed, Bottom-encoded ByteString. Its instances are derived from those of ByteString.

Instances

Instances details
Eq Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

Methods

(==) :: Bottom -> Bottom -> Bool #

(/=) :: Bottom -> Bottom -> Bool #

Ord Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

Show Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

Semigroup Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

Monoid Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

NFData Bottom Source # 
Instance details

Defined in Data.Encoding.Bottom

Methods

rnf :: Bottom -> () #

unBottom :: Bottom -> ByteString Source #

unBottom unwraps the underlying ByteString.

encode :: Text -> Bottom Source #

encode takes a Text, and encodes it into a Bottom. To get at the underlying ByteString, unwrap the returned value with unBottom.

decode :: Bottom -> Text Source #

decode decodes a Bottom into its corresponding Unicode Text.

decode' :: ByteString -> Either Text Text Source #

decode' decodes an arbitrary Bottom-encoded ByteString into a Text, or returns a parse error if the ByteString is malformed.