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

LicenseBSD3
Stabilityexperimental
Portabilitytype-families
Safe HaskellSafe
LanguageHaskell98

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 :: *

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

type family Signed i :: *

Instances

type Signed Int = Int 
type Signed Int8 = Int8 
type Signed Int16 = Int16 
type Signed Int32 = Int32 
type Signed Int64 = Int64 
type Signed Integer = Integer 
type Signed Word = Int 
type Signed Word8 = Int8 
type Signed Word16 = Int16 
type Signed Word32 = Int32 
type Signed Word64 = Int64 
type Signed (VarInt n) = VarInt (Signed n) 

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