basement-0.0.11: Foundation scrap box of array & string

LicenseBSD-style
MaintainerHaskell Foundation
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Basement.Types.AsciiString

Contents

Description

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

Synopsis

Documentation

newtype AsciiString Source #

Opaque packed array of characters in the ASCII encoding

Constructors

AsciiString 

Fields

Instances
IsList AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Associated Types

type Item AsciiString :: Type #

Eq AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Ord AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Show AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

IsString AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Semigroup AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Monoid AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

From AsciiString String Source # 
Instance details

Defined in Basement.From

From AsciiString (UArray Word8) Source # 
Instance details

Defined in Basement.From

type Item AsciiString Source # 
Instance details

Defined in Basement.Types.AsciiString

Binary conversion

fromBytesUnsafe :: UArray Word8 -> AsciiString Source #

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 Source #

Convert a Byte Array representing ASCII checking validity.

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