ascii-superset-1.0.1.13: Representing ASCII with refined supersets
Safe HaskellNone
LanguageHaskell2010

ASCII.Lift

Synopsis
  • class Lift subset superset where
    • lift :: subset -> superset

Documentation

class Lift subset superset where Source #

Embedding of one character set within another

The subset and superset types may be characters or strings in ASCII, some subset of ASCII, or some superset of ASCII.

Methods

lift :: subset -> superset Source #

Converts from a smaller to a larger type.

>>> lift CapitalLetterA :: Word8
65
>>> lift [CapitalLetterH,SmallLetterI,ExclamationMark] :: Text
"Hi!"

Due to the highly polymorphic nature of the lift function, often it must used with an explicit type signature or type application to avoid any type ambiguity.

Instances

Instances details
CharSuperset superset => Lift Char superset Source #

An ASCII Char may be lifted into any larger character set (a CharSuperset); for example, lift can convert an ASCII character into a value of the standard Char type in Prelude.

Instance details

Defined in ASCII.Lift

Methods

lift :: Char -> superset Source #

StringSuperset superset => Lift [Char] superset Source #

An ASCII Char list may be lifted into a string of any larger character set (a StringSuperset); for example, lift can convert a list of ASCII characters into a value of the standard String type in Prelude.

Instance details

Defined in ASCII.Lift

Methods

lift :: [Char] -> superset Source #

Lift (ASCII superset) superset Source #

A value from an ASCII superset that has been refined by the ASCII type constructor may be lifted back into the superset by unwrapping it from the ASCII type.

Instance details

Defined in ASCII.Lift

Methods

lift :: ASCII superset -> superset Source #