basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | Safe-Inferred
Language | Haskell2010

Basement.Types.Char7

Contents

- individual ASCII Characters
- Upper / Lower With ASCII

Synopsis

- newtype Char7 = Char7 {
  - toByte :: Word8
  }
- toChar :: Char7 -> Char
- fromCharMask :: Char -> Char7
- fromChar :: Char -> Maybe Char7
- fromByteMask :: Word8 -> Char7
- fromByte :: Word8 -> Maybe Char7
- c7_LF :: Char7
- c7_CR :: Char7
- c7_minus :: Char7
- c7_a :: Char7
- c7_A :: Char7
- c7_z :: Char7
- c7_Z :: Char7
- c7_0 :: Char7
- c7_1 :: Char7
- c7_2 :: Char7
- c7_3 :: Char7
- c7_4 :: Char7
- c7_5 :: Char7
- c7_6 :: Char7
- c7_7 :: Char7
- c7_8 :: Char7
- c7_9 :: Char7
- c7Upper :: Char7 -> Char7
- c7Lower :: Char7 -> Char7

# Documentation

newtype Char7 Source #

ASCII value between 0x0 and 0x7f

Constructors

Char7 |

Fields

- toByte :: Word8

#### Instances

Instances details

Show Char7 Source # |
Instance details Defined in Basement.Types.Char7 Methods showsPrec :: Int -> Char7 -> ShowS Source # show :: Char7 -> String Source # showList :: [Char7] -> ShowS Source #
NormalForm Char7 Source # |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () Source #
PrimType Char7 Source # |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Char7 :: Nat Source #

Methods

primSizeInBytes :: Proxy Char7 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Char7 -> Int Source #

primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 Source #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 Source #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () Source #

primAddrIndex :: Addr# -> Offset Char7 -> Char7 Source #

primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 Source #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () Source #

Eq Char7 Source # |
Instance details Defined in Basement.Types.Char7 Methods (==) :: Char7 -> Char7 -> Bool Source # (/=) :: Char7 -> Char7 -> Bool Source #
Ord Char7 Source # |
Instance details Defined in Basement.Types.Char7 Methods compare :: Char7 -> Char7 -> Ordering Source # (<) :: Char7 -> Char7 -> Bool Source # (<=) :: Char7 -> Char7 -> Bool Source # (>) :: Char7 -> Char7 -> Bool Source # (>=) :: Char7 -> Char7 -> Bool Source # max :: Char7 -> Char7 -> Char7 Source # min :: Char7 -> Char7 -> Char7 Source #
type NatNumMaxBound Char7 Source # |
Instance details Defined in Basement.Nat type NatNumMaxBound Char7 = 127
type PrimSize Char7 Source # |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1

toChar :: Char7 -> Char Source #

Convert a `Char7` to a unicode code point `Char`

fromCharMask :: Char -> Char7 Source #

Convert a `Char` to a `Char7` ignoring all higher bits

fromChar :: Char -> Maybe Char7 Source #

Try to convert a `Char` to a `Char7`

If the code point is non ascii, then Nothing is returned.

fromByteMask :: Word8 -> Char7 Source #

Convert a `Byte` to a `Char7` ignoring the higher bit

fromByte :: Word8 -> Maybe Char7 Source #

Try to convert `Word8` to a `Char7`

If the byte got higher bit set, then Nothing is returned.

# individual ASCII Characters

c7_LF :: Char7 Source #

c7_CR :: Char7 Source #

c7_minus :: Char7 Source #

c7_a :: Char7 Source #

c7_A :: Char7 Source #

c7_z :: Char7 Source #

c7_Z :: Char7 Source #

c7_0 :: Char7 Source #

c7_1 :: Char7 Source #

c7_2 :: Char7 Source #

c7_3 :: Char7 Source #

c7_4 :: Char7 Source #

c7_5 :: Char7 Source #

c7_6 :: Char7 Source #

c7_7 :: Char7 Source #

c7_8 :: Char7 Source #

c7_9 :: Char7 Source #

# Upper / Lower With ASCII

c7Upper :: Char7 -> Char7 Source #

c7Lower :: Char7 -> Char7 Source #