basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
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 #

ASCII value between 0x0 and 0x7f

Constructors

Char7 |
Fields toByte :: Word8

#### Instances

Instances details

NormalForm Char7 # |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () #
PrimType Char7 # |
Instance details Defined in Basement.PrimType Associated Types
type PrimSize Char7 |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1
Methods primSizeInBytes :: Proxy Char7 -> CountOf Word8 # primShiftToBytes :: Proxy Char7 -> Int # primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () # primAddrIndex :: Addr# -> Offset Char7 -> Char7 # primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () #
Show Char7 # |
Instance details Defined in Basement.Types.Char7 Methods showsPrec :: Int -> Char7 -> ShowS # show :: Char7 -> String # showList :: [Char7] -> ShowS #
Eq Char7 # |
Instance details Defined in Basement.Types.Char7 Methods (==) :: Char7 -> Char7 -> Bool # (/=) :: Char7 -> Char7 -> Bool #
Ord Char7 # |
Instance details Defined in Basement.Types.Char7 Methods compare :: Char7 -> Char7 -> Ordering # (<) :: Char7 -> Char7 -> Bool # (<=) :: Char7 -> Char7 -> Bool # (>) :: Char7 -> Char7 -> Bool # (>=) :: Char7 -> Char7 -> Bool # max :: Char7 -> Char7 -> Char7 # min :: Char7 -> Char7 -> Char7 #
type NatNumMaxBound Char7 # |
Instance details Defined in Basement.Nat type NatNumMaxBound Char7 = 127
type PrimSize Char7 # |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1

toChar :: Char7 -> Char #

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

fromCharMask :: Char -> Char7 #

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

fromChar :: Char -> Maybe Char7 #

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

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

fromByteMask :: Word8 -> Char7 #

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

fromByte :: Word8 -> Maybe Char7 #

Try to convert `Word8` to a `Char7`

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

# individual ASCII Characters

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 #

# Upper / Lower With ASCII

c7Upper :: Char7 -> Char7 #

c7Lower :: Char7 -> Char7 #