foundation-0.0.13: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerHaskell Foundation
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Foundation.String.ASCII

Contents

Description

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

The recommended type is AsciiString from UTF8

Synopsis

Documentation

create :: PrimMonad prim => CountOf CUChar -> (MutableAsciiString (PrimState prim) -> prim (Offset CUChar)) -> prim AsciiString

Binary conversion

fromBytesUnsafe :: UArray CUChar -> AsciiString

Convert a Byte Array representing UTF8 data directly to a string without checking for UTF8 validity

If the input contains invalid sequences, it will trigger runtime async errors when processing data.

In doubt, use fromBytes

copy :: AsciiString -> AsciiString

Copy the AsciiString

Legacy utility