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

ASCII.Lift

Documentation

class Lift ascii superset where Source #

Methods

lift :: ascii -> superset Source #

Converts from ASCII to any 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 #