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

ASCII.Superset

Synopsis

Characters

Class

class CharSuperset char where Source #

Methods

isAsciiChar :: char -> Bool Source #

fromChar :: Char -> char Source #

toCharUnsafe :: char -> Char Source #

Instances

Instances details
CharSuperset Char Source # 
Instance details

Defined in ASCII.Superset

CharSuperset Int Source # 
Instance details

Defined in ASCII.Superset

CharSuperset Natural Source # 
Instance details

Defined in ASCII.Superset

CharSuperset Word8 Source # 
Instance details

Defined in ASCII.Superset

CharSuperset Char Source #

Char is trivially a superset of itself. (This instance is uninteresting.)

Instance details

Defined in ASCII.Superset

CharSuperset char => CharSuperset (ASCII char) Source # 
Instance details

Defined in ASCII.Refinement

Functions

asCharUnsafe :: CharSuperset char => (Char -> Char) -> char -> char Source #

toCharOrFail :: (CharSuperset char, MonadFail context) => char -> context Char Source #

toCharSub :: CharSuperset char => char -> Char Source #

substituteChar :: CharSuperset char => char -> char Source #

convertCharMaybe :: (CharSuperset char1, CharSuperset char2) => char1 -> Maybe char2 Source #

Convert from one ASCII-superset character type to another via the ASCII Char type. Fails as Nothing if the input is outside the ASCII character set.

convertCharOrFail :: (CharSuperset char1, CharSuperset char2, MonadFail context) => char1 -> context char2 Source #

Convert from one ASCII-superset character type to another via the ASCII Char type. Fails with fail if the input is outside the ASCII character set.

Strings

Class

class StringSuperset string where Source #

Methods

isAsciiString :: string -> Bool Source #

fromCharList :: [Char] -> string Source #

toCharListUnsafe :: string -> [Char] Source #

toCharListSub :: string -> [Char] Source #

substituteString :: string -> string Source #

mapCharsUnsafe :: (Char -> Char) -> string -> string Source #

Instances

Instances details
StringSuperset ByteString Source # 
Instance details

Defined in ASCII.Superset

StringSuperset ByteString Source # 
Instance details

Defined in ASCII.Superset

StringSuperset Builder Source # 
Instance details

Defined in ASCII.Superset

StringSuperset Builder Source # 
Instance details

Defined in ASCII.Superset

StringSuperset Text Source # 
Instance details

Defined in ASCII.Superset

StringSuperset Text Source # 
Instance details

Defined in ASCII.Superset

CharSuperset char => StringSuperset [char] Source # 
Instance details

Defined in ASCII.Superset

Methods

isAsciiString :: [char] -> Bool Source #

fromCharList :: [Char] -> [char] Source #

toCharListUnsafe :: [char] -> [Char] Source #

toCharListSub :: [char] -> [Char] Source #

substituteString :: [char] -> [char] Source #

mapCharsUnsafe :: (Char -> Char) -> [char] -> [char] Source #

StringSuperset string => StringSuperset (ASCII string) Source # 
Instance details

Defined in ASCII.Refinement

Methods

isAsciiString :: ASCII string -> Bool Source #

fromCharList :: [Char] -> ASCII string Source #

toCharListUnsafe :: ASCII string -> [Char] Source #

toCharListSub :: ASCII string -> [Char] Source #

substituteString :: ASCII string -> ASCII string Source #

mapCharsUnsafe :: (Char -> Char) -> ASCII string -> ASCII string Source #

Functions

toCharListMaybe :: StringSuperset string => string -> Maybe [Char] Source #

toCharListOrFail :: (StringSuperset string, MonadFail context) => string -> context [Char] Source #

convertStringMaybe :: (StringSuperset string1, StringSuperset string2) => string1 -> Maybe string2 Source #

Convert from one ASCII-superset string type to another by converting each character of the input string to an ASCII Char, and then converting the ASCII character list to the desired output type. Fails as Nothing if the input contains any character that is outside the ASCII character set.

convertStringOrFail :: (StringSuperset string1, StringSuperset string2, MonadFail context) => string1 -> context string2 Source #

Convert from one ASCII-superset string type to another by converting each character of the input string to an ASCII Char, and then converting the ASCII character list to the desired output type. Fails with fail if the input contains any character that is outside the ASCII character set.