basement-0.0.12: Foundation scrap box of array & string
LicenseBSD-style
MaintainerHaskell Foundation
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Basement.Types.AsciiString

Description

A AsciiString type backed by a ASCII encoded byte array and all the necessary functions to manipulate the string.

Synopsis

Documentation

newtype AsciiString #

Opaque packed array of characters in the ASCII encoding

Constructors

AsciiString 

Fields

Instances

Instances details
IsList AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

Associated Types

type Item AsciiString #

Eq AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

Ord AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

Show AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

IsString AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

Semigroup AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

Monoid AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

From AsciiString String # 
Instance details

Defined in Basement.From

Methods

from :: AsciiString -> String #

From AsciiString (UArray Word8) # 
Instance details

Defined in Basement.From

type Item AsciiString # 
Instance details

Defined in Basement.Types.AsciiString

newtype MutableAsciiString st #

Constructors

MutableAsciiString (MUArray Char7 st) 

Binary conversion

fromBytesUnsafe :: UArray Word8 -> AsciiString #

Convert a Byte Array representing ASCII data directly to an AsciiString without checking for ASCII validity

If the input contains invalid Char7 value (anything above 0x7f), it will trigger runtime async errors when processing data.

In doubt, use fromBytes

fromBytes :: UArray Word8 -> Maybe AsciiString #

Convert a Byte Array representing ASCII checking validity.

If the byte array is not valid, then Nothing is returned