bytes-0.17.4: Sharing code for serialization between binary and cereal

License | BSD3
Stability | experimental
Portability | type-families
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Bytes.Signed

Description

When one wants to think of an `Int` as a dumb bitstring, converting it to a `Word` avoids pesky complications with respect to sign extension.

# Documentation

type family Unsigned i Source #

#### Instances

Instances details

type Unsigned Int16 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Int16 = Word16
type Unsigned Int32 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Int32 = Word32
type Unsigned Int64 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Int64 = Word64
type Unsigned Int8 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Int8 = Word8
type Unsigned Word16 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Word16 = Word16
type Unsigned Word32 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Word32 = Word32
type Unsigned Word64 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Word64 = Word64
type Unsigned Word8 Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Word8 = Word8
type Unsigned Integer Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Integer = Integer
type Unsigned Int Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Int = Word
type Unsigned Word Source # |
Instance details Defined in Data.Bytes.Signed type Unsigned Word = Word
type Unsigned (VarInt n) Source # |
Instance details Defined in Data.Bytes.VarInt type Unsigned (VarInt n) = VarInt (Unsigned n)

unsigned :: (Integral i, Num (Unsigned i)) => i -> Unsigned i Source #

type family Signed i Source #

#### Instances

Instances details

type Signed Int16 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Int16 = Int16
type Signed Int32 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Int32 = Int32
type Signed Int64 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Int64 = Int64
type Signed Int8 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Int8 = Int8
type Signed Word16 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Word16 = Int16
type Signed Word32 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Word32 = Int32
type Signed Word64 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Word64 = Int64
type Signed Word8 Source # |
Instance details Defined in Data.Bytes.Signed type Signed Word8 = Int8
type Signed Integer Source # |
Instance details Defined in Data.Bytes.Signed type Signed Integer = Integer
type Signed Int Source # |
Instance details Defined in Data.Bytes.Signed type Signed Int = Int
type Signed Word Source # |
Instance details Defined in Data.Bytes.Signed type Signed Word = Int
type Signed (VarInt n) Source # |
Instance details Defined in Data.Bytes.VarInt type Signed (VarInt n) = VarInt (Signed n)

signed :: (Integral i, Num (Signed i)) => i -> Signed i Source #