zm-0.3.2: Language independent, reproducible, absolute types

Safe HaskellNone
LanguageHaskell2010

ZM.Type.Words

Synopsis

Documentation

data Sign Source #

Constructors

Positive 
Negative 

Instances

Eq Sign Source # 

Methods

(==) :: Sign -> Sign -> Bool #

(/=) :: Sign -> Sign -> Bool #

Ord Sign Source # 

Methods

compare :: Sign -> Sign -> Ordering #

(<) :: Sign -> Sign -> Bool #

(<=) :: Sign -> Sign -> Bool #

(>) :: Sign -> Sign -> Bool #

(>=) :: Sign -> Sign -> Bool #

max :: Sign -> Sign -> Sign #

min :: Sign -> Sign -> Sign #

Show Sign Source # 

Methods

showsPrec :: Int -> Sign -> ShowS #

show :: Sign -> String #

showList :: [Sign] -> ShowS #

Generic Sign Source # 

Associated Types

type Rep Sign :: * -> * #

Methods

from :: Sign -> Rep Sign x #

to :: Rep Sign x -> Sign #

Flat Sign Source # 
Model Sign Source # 
type Rep Sign Source # 
type Rep Sign = D1 (MetaData "Sign" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) ((:+:) (C1 (MetaCons "Positive" PrefixI False) U1) (C1 (MetaCons "Negative" PrefixI False) U1))

data Word7 Source #

A 7 bits unsigned integer data Word7 = V0 .. V127

Constructors

Word7 Word8 

Instances

Eq Word7 Source # 

Methods

(==) :: Word7 -> Word7 -> Bool #

(/=) :: Word7 -> Word7 -> Bool #

Ord Word7 Source # 

Methods

compare :: Word7 -> Word7 -> Ordering #

(<) :: Word7 -> Word7 -> Bool #

(<=) :: Word7 -> Word7 -> Bool #

(>) :: Word7 -> Word7 -> Bool #

(>=) :: Word7 -> Word7 -> Bool #

max :: Word7 -> Word7 -> Word7 #

min :: Word7 -> Word7 -> Word7 #

Show Word7 Source # 

Methods

showsPrec :: Int -> Word7 -> ShowS #

show :: Word7 -> String #

showList :: [Word7] -> ShowS #

Generic Word7 Source # 

Associated Types

type Rep Word7 :: * -> * #

Methods

from :: Word7 -> Rep Word7 x #

to :: Rep Word7 x -> Word7 #

Model Word7 Source # 
type Rep Word7 Source # 
type Rep Word7 = D1 (MetaData "Word7" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Word7" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))

data Word Source #

An unsigned integer of arbitrary length encoded as a non empty list of Word7 words with least significant word first and, inside each word, most significant bit first.

Example: 3450 :: Word

Binary representation: 0000110101111010

Split in 7bits groups: 0011010(26) 1111010(122)

Reverse order of groups: Word (Cons V122 (Elem V26))

So Least Significant Byte first with Most Significant Bit first in every 7 bits group.

Instances

Eq Word Source # 

Methods

(==) :: Word -> Word -> Bool #

(/=) :: Word -> Word -> Bool #

Ord Word Source # 

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Show Word Source # 

Methods

showsPrec :: Int -> Word -> ShowS #

show :: Word -> String #

showList :: [Word] -> ShowS #

Generic Word Source # 

Associated Types

type Rep Word :: * -> * #

Methods

from :: Word -> Rep Word x #

to :: Rep Word x -> Word #

Model Word Source # 
type Rep Word Source # 

data Word8 Source #

An 8 bits unsigned integer data Word8 = V0 | V1 .. | V255

Constructors

Word8 Word8 

Instances

Eq Word8 Source # 

Methods

(==) :: Word8 -> Word8 -> Bool #

(/=) :: Word8 -> Word8 -> Bool #

Ord Word8 Source # 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Show Word8 Source # 

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Generic Word8 Source # 

Associated Types

type Rep Word8 :: * -> * #

Methods

from :: Word8 -> Rep Word8 x #

to :: Rep Word8 x -> Word8 #

Model Word8 Source # 
type Rep Word8 Source # 
type Rep Word8 = D1 (MetaData "Word8" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Word8" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))

data Word16 Source #

Constructors

Word16 Word 

Instances

Eq Word16 Source # 

Methods

(==) :: Word16 -> Word16 -> Bool #

(/=) :: Word16 -> Word16 -> Bool #

Ord Word16 Source # 
Show Word16 Source # 
Generic Word16 Source # 

Associated Types

type Rep Word16 :: * -> * #

Methods

from :: Word16 -> Rep Word16 x #

to :: Rep Word16 x -> Word16 #

Model Word16 Source # 
type Rep Word16 Source # 
type Rep Word16 = D1 (MetaData "Word16" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Word16" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word)))

data Word32 Source #

Constructors

Word32 Word 

Instances

Eq Word32 Source # 

Methods

(==) :: Word32 -> Word32 -> Bool #

(/=) :: Word32 -> Word32 -> Bool #

Ord Word32 Source # 
Show Word32 Source # 
Generic Word32 Source # 

Associated Types

type Rep Word32 :: * -> * #

Methods

from :: Word32 -> Rep Word32 x #

to :: Rep Word32 x -> Word32 #

Model Word32 Source # 
type Rep Word32 Source # 
type Rep Word32 = D1 (MetaData "Word32" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Word32" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word)))

data Word64 Source #

Constructors

Word64 Word 

Instances

Eq Word64 Source # 

Methods

(==) :: Word64 -> Word64 -> Bool #

(/=) :: Word64 -> Word64 -> Bool #

Ord Word64 Source # 
Show Word64 Source # 
Generic Word64 Source # 

Associated Types

type Rep Word64 :: * -> * #

Methods

from :: Word64 -> Rep Word64 x #

to :: Rep Word64 x -> Word64 #

Model Word64 Source # 
type Rep Word64 Source # 
type Rep Word64 = D1 (MetaData "Word64" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Word64" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word)))

data Int Source #

Constructors

Int (ZigZag Word) 

Instances

Eq Int Source # 

Methods

(==) :: Int -> Int -> Bool #

(/=) :: Int -> Int -> Bool #

Ord Int Source # 

Methods

compare :: Int -> Int -> Ordering #

(<) :: Int -> Int -> Bool #

(<=) :: Int -> Int -> Bool #

(>) :: Int -> Int -> Bool #

(>=) :: Int -> Int -> Bool #

max :: Int -> Int -> Int #

min :: Int -> Int -> Int #

Show Int Source # 

Methods

showsPrec :: Int -> Int -> ShowS #

show :: Int -> String #

showList :: [Int] -> ShowS #

Generic Int Source # 

Associated Types

type Rep Int :: * -> * #

Methods

from :: Int -> Rep Int x #

to :: Rep Int x -> Int #

Model Int Source # 

Methods

envType :: Proxy * Int -> State Env HType #

type Rep Int Source # 
type Rep Int = D1 (MetaData "Int" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Int" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ZigZag Word))))

data Int8 Source #

Constructors

Int8 (ZigZag Word8) 

Instances

Eq Int8 Source # 

Methods

(==) :: Int8 -> Int8 -> Bool #

(/=) :: Int8 -> Int8 -> Bool #

Ord Int8 Source # 

Methods

compare :: Int8 -> Int8 -> Ordering #

(<) :: Int8 -> Int8 -> Bool #

(<=) :: Int8 -> Int8 -> Bool #

(>) :: Int8 -> Int8 -> Bool #

(>=) :: Int8 -> Int8 -> Bool #

max :: Int8 -> Int8 -> Int8 #

min :: Int8 -> Int8 -> Int8 #

Show Int8 Source # 

Methods

showsPrec :: Int -> Int8 -> ShowS #

show :: Int8 -> String #

showList :: [Int8] -> ShowS #

Generic Int8 Source # 

Associated Types

type Rep Int8 :: * -> * #

Methods

from :: Int8 -> Rep Int8 x #

to :: Rep Int8 x -> Int8 #

Model Int8 Source # 
type Rep Int8 Source # 
type Rep Int8 = D1 (MetaData "Int8" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Int8" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ZigZag Word8))))

data Int16 Source #

Constructors

Int16 (ZigZag Word16) 

Instances

Eq Int16 Source # 

Methods

(==) :: Int16 -> Int16 -> Bool #

(/=) :: Int16 -> Int16 -> Bool #

Ord Int16 Source # 

Methods

compare :: Int16 -> Int16 -> Ordering #

(<) :: Int16 -> Int16 -> Bool #

(<=) :: Int16 -> Int16 -> Bool #

(>) :: Int16 -> Int16 -> Bool #

(>=) :: Int16 -> Int16 -> Bool #

max :: Int16 -> Int16 -> Int16 #

min :: Int16 -> Int16 -> Int16 #

Show Int16 Source # 

Methods

showsPrec :: Int -> Int16 -> ShowS #

show :: Int16 -> String #

showList :: [Int16] -> ShowS #

Generic Int16 Source # 

Associated Types

type Rep Int16 :: * -> * #

Methods

from :: Int16 -> Rep Int16 x #

to :: Rep Int16 x -> Int16 #

Model Int16 Source # 
type Rep Int16 Source # 
type Rep Int16 = D1 (MetaData "Int16" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Int16" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ZigZag Word16))))

data Int32 Source #

Constructors

Int32 (ZigZag Word32) 

Instances

Eq Int32 Source # 

Methods

(==) :: Int32 -> Int32 -> Bool #

(/=) :: Int32 -> Int32 -> Bool #

Ord Int32 Source # 

Methods

compare :: Int32 -> Int32 -> Ordering #

(<) :: Int32 -> Int32 -> Bool #

(<=) :: Int32 -> Int32 -> Bool #

(>) :: Int32 -> Int32 -> Bool #

(>=) :: Int32 -> Int32 -> Bool #

max :: Int32 -> Int32 -> Int32 #

min :: Int32 -> Int32 -> Int32 #

Show Int32 Source # 

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

Generic Int32 Source # 

Associated Types

type Rep Int32 :: * -> * #

Methods

from :: Int32 -> Rep Int32 x #

to :: Rep Int32 x -> Int32 #

Model Int32 Source # 
type Rep Int32 Source # 
type Rep Int32 = D1 (MetaData "Int32" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Int32" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ZigZag Word32))))

data Int64 Source #

Constructors

Int64 (ZigZag Word64) 

Instances

Eq Int64 Source # 

Methods

(==) :: Int64 -> Int64 -> Bool #

(/=) :: Int64 -> Int64 -> Bool #

Ord Int64 Source # 

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Show Int64 Source # 

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Generic Int64 Source # 

Associated Types

type Rep Int64 :: * -> * #

Methods

from :: Int64 -> Rep Int64 x #

to :: Rep Int64 x -> Int64 #

Model Int64 Source # 
type Rep Int64 Source # 
type Rep Int64 = D1 (MetaData "Int64" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "Int64" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ZigZag Word64))))

data ZigZag a Source #

ZigZag encoding, map signed integers to unsigned integers Positive integers are mapped to even unsigned values, negative integers to odd values: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4 ...

Constructors

ZigZag a 

Instances

Eq a => Eq (ZigZag a) Source # 

Methods

(==) :: ZigZag a -> ZigZag a -> Bool #

(/=) :: ZigZag a -> ZigZag a -> Bool #

Ord a => Ord (ZigZag a) Source # 

Methods

compare :: ZigZag a -> ZigZag a -> Ordering #

(<) :: ZigZag a -> ZigZag a -> Bool #

(<=) :: ZigZag a -> ZigZag a -> Bool #

(>) :: ZigZag a -> ZigZag a -> Bool #

(>=) :: ZigZag a -> ZigZag a -> Bool #

max :: ZigZag a -> ZigZag a -> ZigZag a #

min :: ZigZag a -> ZigZag a -> ZigZag a #

Show a => Show (ZigZag a) Source # 

Methods

showsPrec :: Int -> ZigZag a -> ShowS #

show :: ZigZag a -> String #

showList :: [ZigZag a] -> ShowS #

Generic (ZigZag a) Source # 

Associated Types

type Rep (ZigZag a) :: * -> * #

Methods

from :: ZigZag a -> Rep (ZigZag a) x #

to :: Rep (ZigZag a) x -> ZigZag a #

Flat a => Flat (ZigZag a) Source # 

Methods

encode :: ZigZag a -> Encoding #

decode :: Get (ZigZag a) #

size :: ZigZag a -> NumBits -> NumBits #

Model a => Model (ZigZag a) Source # 

Methods

envType :: Proxy * (ZigZag a) -> State Env HType #

type Rep (ZigZag a) Source # 
type Rep (ZigZag a) = D1 (MetaData "ZigZag" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "ZigZag" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

data MostSignificantFirst a Source #

Constructors

MostSignificantFirst a 

Instances

Eq a => Eq (MostSignificantFirst a) Source # 
Ord a => Ord (MostSignificantFirst a) Source # 
Show a => Show (MostSignificantFirst a) Source # 
Generic (MostSignificantFirst a) Source # 
Flat a => Flat (MostSignificantFirst a) Source # 
Model a => Model (MostSignificantFirst a) Source # 
type Rep (MostSignificantFirst a) Source # 
type Rep (MostSignificantFirst a) = D1 (MetaData "MostSignificantFirst" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "MostSignificantFirst" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

data LeastSignificantFirst a Source #

Constructors

LeastSignificantFirst a 

Instances

Eq a => Eq (LeastSignificantFirst a) Source # 
Ord a => Ord (LeastSignificantFirst a) Source # 
Show a => Show (LeastSignificantFirst a) Source # 
Generic (LeastSignificantFirst a) Source # 
Flat a => Flat (LeastSignificantFirst a) Source # 
Model a => Model (LeastSignificantFirst a) Source # 
type Rep (LeastSignificantFirst a) Source # 
type Rep (LeastSignificantFirst a) = D1 (MetaData "LeastSignificantFirst" "ZM.Type.Words" "zm-0.3.2-9EffK4RA8nV74pYjwjqtDn" False) (C1 (MetaCons "LeastSignificantFirst" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))