{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Network.QPACK.Types where
import Imports
newtype AbsoluteIndex = AbsoluteIndex Int deriving (AbsoluteIndex -> AbsoluteIndex -> Bool
(AbsoluteIndex -> AbsoluteIndex -> Bool)
-> (AbsoluteIndex -> AbsoluteIndex -> Bool) -> Eq AbsoluteIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AbsoluteIndex -> AbsoluteIndex -> Bool
== :: AbsoluteIndex -> AbsoluteIndex -> Bool
$c/= :: AbsoluteIndex -> AbsoluteIndex -> Bool
/= :: AbsoluteIndex -> AbsoluteIndex -> Bool
Eq, Eq AbsoluteIndex
Eq AbsoluteIndex =>
(AbsoluteIndex -> AbsoluteIndex -> Ordering)
-> (AbsoluteIndex -> AbsoluteIndex -> Bool)
-> (AbsoluteIndex -> AbsoluteIndex -> Bool)
-> (AbsoluteIndex -> AbsoluteIndex -> Bool)
-> (AbsoluteIndex -> AbsoluteIndex -> Bool)
-> (AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex)
-> Ord AbsoluteIndex
AbsoluteIndex -> AbsoluteIndex -> Bool
AbsoluteIndex -> AbsoluteIndex -> Ordering
AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AbsoluteIndex -> AbsoluteIndex -> Ordering
compare :: AbsoluteIndex -> AbsoluteIndex -> Ordering
$c< :: AbsoluteIndex -> AbsoluteIndex -> Bool
< :: AbsoluteIndex -> AbsoluteIndex -> Bool
$c<= :: AbsoluteIndex -> AbsoluteIndex -> Bool
<= :: AbsoluteIndex -> AbsoluteIndex -> Bool
$c> :: AbsoluteIndex -> AbsoluteIndex -> Bool
> :: AbsoluteIndex -> AbsoluteIndex -> Bool
$c>= :: AbsoluteIndex -> AbsoluteIndex -> Bool
>= :: AbsoluteIndex -> AbsoluteIndex -> Bool
$cmax :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
max :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
$cmin :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
min :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
Ord, Int -> AbsoluteIndex -> ShowS
[AbsoluteIndex] -> ShowS
AbsoluteIndex -> String
(Int -> AbsoluteIndex -> ShowS)
-> (AbsoluteIndex -> String)
-> ([AbsoluteIndex] -> ShowS)
-> Show AbsoluteIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AbsoluteIndex -> ShowS
showsPrec :: Int -> AbsoluteIndex -> ShowS
$cshow :: AbsoluteIndex -> String
show :: AbsoluteIndex -> String
$cshowList :: [AbsoluteIndex] -> ShowS
showList :: [AbsoluteIndex] -> ShowS
Show, Integer -> AbsoluteIndex
AbsoluteIndex -> AbsoluteIndex
AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
(AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex)
-> (AbsoluteIndex -> AbsoluteIndex)
-> (Integer -> AbsoluteIndex)
-> Num AbsoluteIndex
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
+ :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
$c- :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
- :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
$c* :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
* :: AbsoluteIndex -> AbsoluteIndex -> AbsoluteIndex
$cnegate :: AbsoluteIndex -> AbsoluteIndex
negate :: AbsoluteIndex -> AbsoluteIndex
$cabs :: AbsoluteIndex -> AbsoluteIndex
abs :: AbsoluteIndex -> AbsoluteIndex
$csignum :: AbsoluteIndex -> AbsoluteIndex
signum :: AbsoluteIndex -> AbsoluteIndex
$cfromInteger :: Integer -> AbsoluteIndex
fromInteger :: Integer -> AbsoluteIndex
Num)
newtype InsRelativeIndex = InsRelativeIndex Int deriving (InsRelativeIndex -> InsRelativeIndex -> Bool
(InsRelativeIndex -> InsRelativeIndex -> Bool)
-> (InsRelativeIndex -> InsRelativeIndex -> Bool)
-> Eq InsRelativeIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InsRelativeIndex -> InsRelativeIndex -> Bool
== :: InsRelativeIndex -> InsRelativeIndex -> Bool
$c/= :: InsRelativeIndex -> InsRelativeIndex -> Bool
/= :: InsRelativeIndex -> InsRelativeIndex -> Bool
Eq, Eq InsRelativeIndex
Eq InsRelativeIndex =>
(InsRelativeIndex -> InsRelativeIndex -> Ordering)
-> (InsRelativeIndex -> InsRelativeIndex -> Bool)
-> (InsRelativeIndex -> InsRelativeIndex -> Bool)
-> (InsRelativeIndex -> InsRelativeIndex -> Bool)
-> (InsRelativeIndex -> InsRelativeIndex -> Bool)
-> (InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex)
-> Ord InsRelativeIndex
InsRelativeIndex -> InsRelativeIndex -> Bool
InsRelativeIndex -> InsRelativeIndex -> Ordering
InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: InsRelativeIndex -> InsRelativeIndex -> Ordering
compare :: InsRelativeIndex -> InsRelativeIndex -> Ordering
$c< :: InsRelativeIndex -> InsRelativeIndex -> Bool
< :: InsRelativeIndex -> InsRelativeIndex -> Bool
$c<= :: InsRelativeIndex -> InsRelativeIndex -> Bool
<= :: InsRelativeIndex -> InsRelativeIndex -> Bool
$c> :: InsRelativeIndex -> InsRelativeIndex -> Bool
> :: InsRelativeIndex -> InsRelativeIndex -> Bool
$c>= :: InsRelativeIndex -> InsRelativeIndex -> Bool
>= :: InsRelativeIndex -> InsRelativeIndex -> Bool
$cmax :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
max :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
$cmin :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
min :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
Ord, Int -> InsRelativeIndex -> ShowS
[InsRelativeIndex] -> ShowS
InsRelativeIndex -> String
(Int -> InsRelativeIndex -> ShowS)
-> (InsRelativeIndex -> String)
-> ([InsRelativeIndex] -> ShowS)
-> Show InsRelativeIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InsRelativeIndex -> ShowS
showsPrec :: Int -> InsRelativeIndex -> ShowS
$cshow :: InsRelativeIndex -> String
show :: InsRelativeIndex -> String
$cshowList :: [InsRelativeIndex] -> ShowS
showList :: [InsRelativeIndex] -> ShowS
Show, Integer -> InsRelativeIndex
InsRelativeIndex -> InsRelativeIndex
InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
(InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex)
-> (InsRelativeIndex -> InsRelativeIndex)
-> (Integer -> InsRelativeIndex)
-> Num InsRelativeIndex
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
+ :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
$c- :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
- :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
$c* :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
* :: InsRelativeIndex -> InsRelativeIndex -> InsRelativeIndex
$cnegate :: InsRelativeIndex -> InsRelativeIndex
negate :: InsRelativeIndex -> InsRelativeIndex
$cabs :: InsRelativeIndex -> InsRelativeIndex
abs :: InsRelativeIndex -> InsRelativeIndex
$csignum :: InsRelativeIndex -> InsRelativeIndex
signum :: InsRelativeIndex -> InsRelativeIndex
$cfromInteger :: Integer -> InsRelativeIndex
fromInteger :: Integer -> InsRelativeIndex
Num)
newtype PreBaseIndex = PreBaseIndex Int deriving (PreBaseIndex -> PreBaseIndex -> Bool
(PreBaseIndex -> PreBaseIndex -> Bool)
-> (PreBaseIndex -> PreBaseIndex -> Bool) -> Eq PreBaseIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PreBaseIndex -> PreBaseIndex -> Bool
== :: PreBaseIndex -> PreBaseIndex -> Bool
$c/= :: PreBaseIndex -> PreBaseIndex -> Bool
/= :: PreBaseIndex -> PreBaseIndex -> Bool
Eq, Eq PreBaseIndex
Eq PreBaseIndex =>
(PreBaseIndex -> PreBaseIndex -> Ordering)
-> (PreBaseIndex -> PreBaseIndex -> Bool)
-> (PreBaseIndex -> PreBaseIndex -> Bool)
-> (PreBaseIndex -> PreBaseIndex -> Bool)
-> (PreBaseIndex -> PreBaseIndex -> Bool)
-> (PreBaseIndex -> PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex -> PreBaseIndex)
-> Ord PreBaseIndex
PreBaseIndex -> PreBaseIndex -> Bool
PreBaseIndex -> PreBaseIndex -> Ordering
PreBaseIndex -> PreBaseIndex -> PreBaseIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PreBaseIndex -> PreBaseIndex -> Ordering
compare :: PreBaseIndex -> PreBaseIndex -> Ordering
$c< :: PreBaseIndex -> PreBaseIndex -> Bool
< :: PreBaseIndex -> PreBaseIndex -> Bool
$c<= :: PreBaseIndex -> PreBaseIndex -> Bool
<= :: PreBaseIndex -> PreBaseIndex -> Bool
$c> :: PreBaseIndex -> PreBaseIndex -> Bool
> :: PreBaseIndex -> PreBaseIndex -> Bool
$c>= :: PreBaseIndex -> PreBaseIndex -> Bool
>= :: PreBaseIndex -> PreBaseIndex -> Bool
$cmax :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
max :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
$cmin :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
min :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
Ord, Int -> PreBaseIndex -> ShowS
[PreBaseIndex] -> ShowS
PreBaseIndex -> String
(Int -> PreBaseIndex -> ShowS)
-> (PreBaseIndex -> String)
-> ([PreBaseIndex] -> ShowS)
-> Show PreBaseIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PreBaseIndex -> ShowS
showsPrec :: Int -> PreBaseIndex -> ShowS
$cshow :: PreBaseIndex -> String
show :: PreBaseIndex -> String
$cshowList :: [PreBaseIndex] -> ShowS
showList :: [PreBaseIndex] -> ShowS
Show, Integer -> PreBaseIndex
PreBaseIndex -> PreBaseIndex
PreBaseIndex -> PreBaseIndex -> PreBaseIndex
(PreBaseIndex -> PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex)
-> (PreBaseIndex -> PreBaseIndex)
-> (Integer -> PreBaseIndex)
-> Num PreBaseIndex
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
+ :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
$c- :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
- :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
$c* :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
* :: PreBaseIndex -> PreBaseIndex -> PreBaseIndex
$cnegate :: PreBaseIndex -> PreBaseIndex
negate :: PreBaseIndex -> PreBaseIndex
$cabs :: PreBaseIndex -> PreBaseIndex
abs :: PreBaseIndex -> PreBaseIndex
$csignum :: PreBaseIndex -> PreBaseIndex
signum :: PreBaseIndex -> PreBaseIndex
$cfromInteger :: Integer -> PreBaseIndex
fromInteger :: Integer -> PreBaseIndex
Num)
newtype PostBaseIndex = PostBaseIndex Int deriving (PostBaseIndex -> PostBaseIndex -> Bool
(PostBaseIndex -> PostBaseIndex -> Bool)
-> (PostBaseIndex -> PostBaseIndex -> Bool) -> Eq PostBaseIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PostBaseIndex -> PostBaseIndex -> Bool
== :: PostBaseIndex -> PostBaseIndex -> Bool
$c/= :: PostBaseIndex -> PostBaseIndex -> Bool
/= :: PostBaseIndex -> PostBaseIndex -> Bool
Eq, Eq PostBaseIndex
Eq PostBaseIndex =>
(PostBaseIndex -> PostBaseIndex -> Ordering)
-> (PostBaseIndex -> PostBaseIndex -> Bool)
-> (PostBaseIndex -> PostBaseIndex -> Bool)
-> (PostBaseIndex -> PostBaseIndex -> Bool)
-> (PostBaseIndex -> PostBaseIndex -> Bool)
-> (PostBaseIndex -> PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex -> PostBaseIndex)
-> Ord PostBaseIndex
PostBaseIndex -> PostBaseIndex -> Bool
PostBaseIndex -> PostBaseIndex -> Ordering
PostBaseIndex -> PostBaseIndex -> PostBaseIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PostBaseIndex -> PostBaseIndex -> Ordering
compare :: PostBaseIndex -> PostBaseIndex -> Ordering
$c< :: PostBaseIndex -> PostBaseIndex -> Bool
< :: PostBaseIndex -> PostBaseIndex -> Bool
$c<= :: PostBaseIndex -> PostBaseIndex -> Bool
<= :: PostBaseIndex -> PostBaseIndex -> Bool
$c> :: PostBaseIndex -> PostBaseIndex -> Bool
> :: PostBaseIndex -> PostBaseIndex -> Bool
$c>= :: PostBaseIndex -> PostBaseIndex -> Bool
>= :: PostBaseIndex -> PostBaseIndex -> Bool
$cmax :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
max :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
$cmin :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
min :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
Ord, Int -> PostBaseIndex -> ShowS
[PostBaseIndex] -> ShowS
PostBaseIndex -> String
(Int -> PostBaseIndex -> ShowS)
-> (PostBaseIndex -> String)
-> ([PostBaseIndex] -> ShowS)
-> Show PostBaseIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PostBaseIndex -> ShowS
showsPrec :: Int -> PostBaseIndex -> ShowS
$cshow :: PostBaseIndex -> String
show :: PostBaseIndex -> String
$cshowList :: [PostBaseIndex] -> ShowS
showList :: [PostBaseIndex] -> ShowS
Show, Integer -> PostBaseIndex
PostBaseIndex -> PostBaseIndex
PostBaseIndex -> PostBaseIndex -> PostBaseIndex
(PostBaseIndex -> PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex)
-> (PostBaseIndex -> PostBaseIndex)
-> (Integer -> PostBaseIndex)
-> Num PostBaseIndex
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
+ :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
$c- :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
- :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
$c* :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
* :: PostBaseIndex -> PostBaseIndex -> PostBaseIndex
$cnegate :: PostBaseIndex -> PostBaseIndex
negate :: PostBaseIndex -> PostBaseIndex
$cabs :: PostBaseIndex -> PostBaseIndex
abs :: PostBaseIndex -> PostBaseIndex
$csignum :: PostBaseIndex -> PostBaseIndex
signum :: PostBaseIndex -> PostBaseIndex
$cfromInteger :: Integer -> PostBaseIndex
fromInteger :: Integer -> PostBaseIndex
Num)
newtype BasePoint = BasePoint Int deriving (BasePoint -> BasePoint -> Bool
(BasePoint -> BasePoint -> Bool)
-> (BasePoint -> BasePoint -> Bool) -> Eq BasePoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BasePoint -> BasePoint -> Bool
== :: BasePoint -> BasePoint -> Bool
$c/= :: BasePoint -> BasePoint -> Bool
/= :: BasePoint -> BasePoint -> Bool
Eq, Eq BasePoint
Eq BasePoint =>
(BasePoint -> BasePoint -> Ordering)
-> (BasePoint -> BasePoint -> Bool)
-> (BasePoint -> BasePoint -> Bool)
-> (BasePoint -> BasePoint -> Bool)
-> (BasePoint -> BasePoint -> Bool)
-> (BasePoint -> BasePoint -> BasePoint)
-> (BasePoint -> BasePoint -> BasePoint)
-> Ord BasePoint
BasePoint -> BasePoint -> Bool
BasePoint -> BasePoint -> Ordering
BasePoint -> BasePoint -> BasePoint
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: BasePoint -> BasePoint -> Ordering
compare :: BasePoint -> BasePoint -> Ordering
$c< :: BasePoint -> BasePoint -> Bool
< :: BasePoint -> BasePoint -> Bool
$c<= :: BasePoint -> BasePoint -> Bool
<= :: BasePoint -> BasePoint -> Bool
$c> :: BasePoint -> BasePoint -> Bool
> :: BasePoint -> BasePoint -> Bool
$c>= :: BasePoint -> BasePoint -> Bool
>= :: BasePoint -> BasePoint -> Bool
$cmax :: BasePoint -> BasePoint -> BasePoint
max :: BasePoint -> BasePoint -> BasePoint
$cmin :: BasePoint -> BasePoint -> BasePoint
min :: BasePoint -> BasePoint -> BasePoint
Ord, Int -> BasePoint -> ShowS
[BasePoint] -> ShowS
BasePoint -> String
(Int -> BasePoint -> ShowS)
-> (BasePoint -> String)
-> ([BasePoint] -> ShowS)
-> Show BasePoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BasePoint -> ShowS
showsPrec :: Int -> BasePoint -> ShowS
$cshow :: BasePoint -> String
show :: BasePoint -> String
$cshowList :: [BasePoint] -> ShowS
showList :: [BasePoint] -> ShowS
Show, Integer -> BasePoint
BasePoint -> BasePoint
BasePoint -> BasePoint -> BasePoint
(BasePoint -> BasePoint -> BasePoint)
-> (BasePoint -> BasePoint -> BasePoint)
-> (BasePoint -> BasePoint -> BasePoint)
-> (BasePoint -> BasePoint)
-> (BasePoint -> BasePoint)
-> (BasePoint -> BasePoint)
-> (Integer -> BasePoint)
-> Num BasePoint
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: BasePoint -> BasePoint -> BasePoint
+ :: BasePoint -> BasePoint -> BasePoint
$c- :: BasePoint -> BasePoint -> BasePoint
- :: BasePoint -> BasePoint -> BasePoint
$c* :: BasePoint -> BasePoint -> BasePoint
* :: BasePoint -> BasePoint -> BasePoint
$cnegate :: BasePoint -> BasePoint
negate :: BasePoint -> BasePoint
$cabs :: BasePoint -> BasePoint
abs :: BasePoint -> BasePoint
$csignum :: BasePoint -> BasePoint
signum :: BasePoint -> BasePoint
$cfromInteger :: Integer -> BasePoint
fromInteger :: Integer -> BasePoint
Num)
newtype InsertionPoint = InsertionPoint Int deriving (InsertionPoint -> InsertionPoint -> Bool
(InsertionPoint -> InsertionPoint -> Bool)
-> (InsertionPoint -> InsertionPoint -> Bool) -> Eq InsertionPoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InsertionPoint -> InsertionPoint -> Bool
== :: InsertionPoint -> InsertionPoint -> Bool
$c/= :: InsertionPoint -> InsertionPoint -> Bool
/= :: InsertionPoint -> InsertionPoint -> Bool
Eq, Eq InsertionPoint
Eq InsertionPoint =>
(InsertionPoint -> InsertionPoint -> Ordering)
-> (InsertionPoint -> InsertionPoint -> Bool)
-> (InsertionPoint -> InsertionPoint -> Bool)
-> (InsertionPoint -> InsertionPoint -> Bool)
-> (InsertionPoint -> InsertionPoint -> Bool)
-> (InsertionPoint -> InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint -> InsertionPoint)
-> Ord InsertionPoint
InsertionPoint -> InsertionPoint -> Bool
InsertionPoint -> InsertionPoint -> Ordering
InsertionPoint -> InsertionPoint -> InsertionPoint
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: InsertionPoint -> InsertionPoint -> Ordering
compare :: InsertionPoint -> InsertionPoint -> Ordering
$c< :: InsertionPoint -> InsertionPoint -> Bool
< :: InsertionPoint -> InsertionPoint -> Bool
$c<= :: InsertionPoint -> InsertionPoint -> Bool
<= :: InsertionPoint -> InsertionPoint -> Bool
$c> :: InsertionPoint -> InsertionPoint -> Bool
> :: InsertionPoint -> InsertionPoint -> Bool
$c>= :: InsertionPoint -> InsertionPoint -> Bool
>= :: InsertionPoint -> InsertionPoint -> Bool
$cmax :: InsertionPoint -> InsertionPoint -> InsertionPoint
max :: InsertionPoint -> InsertionPoint -> InsertionPoint
$cmin :: InsertionPoint -> InsertionPoint -> InsertionPoint
min :: InsertionPoint -> InsertionPoint -> InsertionPoint
Ord, Int -> InsertionPoint -> ShowS
[InsertionPoint] -> ShowS
InsertionPoint -> String
(Int -> InsertionPoint -> ShowS)
-> (InsertionPoint -> String)
-> ([InsertionPoint] -> ShowS)
-> Show InsertionPoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InsertionPoint -> ShowS
showsPrec :: Int -> InsertionPoint -> ShowS
$cshow :: InsertionPoint -> String
show :: InsertionPoint -> String
$cshowList :: [InsertionPoint] -> ShowS
showList :: [InsertionPoint] -> ShowS
Show, Integer -> InsertionPoint
InsertionPoint -> InsertionPoint
InsertionPoint -> InsertionPoint -> InsertionPoint
(InsertionPoint -> InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint)
-> (InsertionPoint -> InsertionPoint)
-> (Integer -> InsertionPoint)
-> Num InsertionPoint
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: InsertionPoint -> InsertionPoint -> InsertionPoint
+ :: InsertionPoint -> InsertionPoint -> InsertionPoint
$c- :: InsertionPoint -> InsertionPoint -> InsertionPoint
- :: InsertionPoint -> InsertionPoint -> InsertionPoint
$c* :: InsertionPoint -> InsertionPoint -> InsertionPoint
* :: InsertionPoint -> InsertionPoint -> InsertionPoint
$cnegate :: InsertionPoint -> InsertionPoint
negate :: InsertionPoint -> InsertionPoint
$cabs :: InsertionPoint -> InsertionPoint
abs :: InsertionPoint -> InsertionPoint
$csignum :: InsertionPoint -> InsertionPoint
signum :: InsertionPoint -> InsertionPoint
$cfromInteger :: Integer -> InsertionPoint
fromInteger :: Integer -> InsertionPoint
Num)
newtype RequiredInsertCount = RequiredInsertCount Int
deriving (RequiredInsertCount -> RequiredInsertCount -> Bool
(RequiredInsertCount -> RequiredInsertCount -> Bool)
-> (RequiredInsertCount -> RequiredInsertCount -> Bool)
-> Eq RequiredInsertCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RequiredInsertCount -> RequiredInsertCount -> Bool
== :: RequiredInsertCount -> RequiredInsertCount -> Bool
$c/= :: RequiredInsertCount -> RequiredInsertCount -> Bool
/= :: RequiredInsertCount -> RequiredInsertCount -> Bool
Eq, Eq RequiredInsertCount
Eq RequiredInsertCount =>
(RequiredInsertCount -> RequiredInsertCount -> Ordering)
-> (RequiredInsertCount -> RequiredInsertCount -> Bool)
-> (RequiredInsertCount -> RequiredInsertCount -> Bool)
-> (RequiredInsertCount -> RequiredInsertCount -> Bool)
-> (RequiredInsertCount -> RequiredInsertCount -> Bool)
-> (RequiredInsertCount
-> RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount
-> RequiredInsertCount -> RequiredInsertCount)
-> Ord RequiredInsertCount
RequiredInsertCount -> RequiredInsertCount -> Bool
RequiredInsertCount -> RequiredInsertCount -> Ordering
RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: RequiredInsertCount -> RequiredInsertCount -> Ordering
compare :: RequiredInsertCount -> RequiredInsertCount -> Ordering
$c< :: RequiredInsertCount -> RequiredInsertCount -> Bool
< :: RequiredInsertCount -> RequiredInsertCount -> Bool
$c<= :: RequiredInsertCount -> RequiredInsertCount -> Bool
<= :: RequiredInsertCount -> RequiredInsertCount -> Bool
$c> :: RequiredInsertCount -> RequiredInsertCount -> Bool
> :: RequiredInsertCount -> RequiredInsertCount -> Bool
$c>= :: RequiredInsertCount -> RequiredInsertCount -> Bool
>= :: RequiredInsertCount -> RequiredInsertCount -> Bool
$cmax :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
max :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
$cmin :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
min :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
Ord, Int -> RequiredInsertCount -> ShowS
[RequiredInsertCount] -> ShowS
RequiredInsertCount -> String
(Int -> RequiredInsertCount -> ShowS)
-> (RequiredInsertCount -> String)
-> ([RequiredInsertCount] -> ShowS)
-> Show RequiredInsertCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RequiredInsertCount -> ShowS
showsPrec :: Int -> RequiredInsertCount -> ShowS
$cshow :: RequiredInsertCount -> String
show :: RequiredInsertCount -> String
$cshowList :: [RequiredInsertCount] -> ShowS
showList :: [RequiredInsertCount] -> ShowS
Show, Integer -> RequiredInsertCount
RequiredInsertCount -> RequiredInsertCount
RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
(RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount
-> RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount
-> RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount -> RequiredInsertCount)
-> (RequiredInsertCount -> RequiredInsertCount)
-> (Integer -> RequiredInsertCount)
-> Num RequiredInsertCount
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
+ :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
$c- :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
- :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
$c* :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
* :: RequiredInsertCount -> RequiredInsertCount -> RequiredInsertCount
$cnegate :: RequiredInsertCount -> RequiredInsertCount
negate :: RequiredInsertCount -> RequiredInsertCount
$cabs :: RequiredInsertCount -> RequiredInsertCount
abs :: RequiredInsertCount -> RequiredInsertCount
$csignum :: RequiredInsertCount -> RequiredInsertCount
signum :: RequiredInsertCount -> RequiredInsertCount
$cfromInteger :: Integer -> RequiredInsertCount
fromInteger :: Integer -> RequiredInsertCount
Num)
data HIndex
= SIndex AbsoluteIndex
| DIndex AbsoluteIndex
deriving (HIndex -> HIndex -> Bool
(HIndex -> HIndex -> Bool)
-> (HIndex -> HIndex -> Bool) -> Eq HIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HIndex -> HIndex -> Bool
== :: HIndex -> HIndex -> Bool
$c/= :: HIndex -> HIndex -> Bool
/= :: HIndex -> HIndex -> Bool
Eq, Eq HIndex
Eq HIndex =>
(HIndex -> HIndex -> Ordering)
-> (HIndex -> HIndex -> Bool)
-> (HIndex -> HIndex -> Bool)
-> (HIndex -> HIndex -> Bool)
-> (HIndex -> HIndex -> Bool)
-> (HIndex -> HIndex -> HIndex)
-> (HIndex -> HIndex -> HIndex)
-> Ord HIndex
HIndex -> HIndex -> Bool
HIndex -> HIndex -> Ordering
HIndex -> HIndex -> HIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HIndex -> HIndex -> Ordering
compare :: HIndex -> HIndex -> Ordering
$c< :: HIndex -> HIndex -> Bool
< :: HIndex -> HIndex -> Bool
$c<= :: HIndex -> HIndex -> Bool
<= :: HIndex -> HIndex -> Bool
$c> :: HIndex -> HIndex -> Bool
> :: HIndex -> HIndex -> Bool
$c>= :: HIndex -> HIndex -> Bool
>= :: HIndex -> HIndex -> Bool
$cmax :: HIndex -> HIndex -> HIndex
max :: HIndex -> HIndex -> HIndex
$cmin :: HIndex -> HIndex -> HIndex
min :: HIndex -> HIndex -> HIndex
Ord, Int -> HIndex -> ShowS
[HIndex] -> ShowS
HIndex -> String
(Int -> HIndex -> ShowS)
-> (HIndex -> String) -> ([HIndex] -> ShowS) -> Show HIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HIndex -> ShowS
showsPrec :: Int -> HIndex -> ShowS
$cshow :: HIndex -> String
show :: HIndex -> String
$cshowList :: [HIndex] -> ShowS
showList :: [HIndex] -> ShowS
Show)
toInsRelativeIndex :: AbsoluteIndex -> InsertionPoint -> InsRelativeIndex
toInsRelativeIndex :: AbsoluteIndex -> InsertionPoint -> InsRelativeIndex
toInsRelativeIndex (AbsoluteIndex Int
idx) (InsertionPoint Int
ip) =
Int -> InsRelativeIndex
InsRelativeIndex (Int
ip Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
idx Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
fromInsRelativeIndex :: InsRelativeIndex -> InsertionPoint -> AbsoluteIndex
fromInsRelativeIndex :: InsRelativeIndex -> InsertionPoint -> AbsoluteIndex
fromInsRelativeIndex (InsRelativeIndex Int
ri) (InsertionPoint Int
ip) =
Int -> AbsoluteIndex
AbsoluteIndex (Int
ip Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
ri Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
toBaseIndex :: AbsoluteIndex -> BasePoint -> Either PreBaseIndex PostBaseIndex
toBaseIndex :: AbsoluteIndex -> BasePoint -> Either PreBaseIndex PostBaseIndex
toBaseIndex (AbsoluteIndex Int
idx) (BasePoint Int
bp)
| Int
idx Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
bp = PreBaseIndex -> Either PreBaseIndex PostBaseIndex
forall a b. a -> Either a b
Left (PreBaseIndex -> Either PreBaseIndex PostBaseIndex)
-> PreBaseIndex -> Either PreBaseIndex PostBaseIndex
forall a b. (a -> b) -> a -> b
$ Int -> PreBaseIndex
PreBaseIndex (Int
bp Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
idx Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
| Bool
otherwise = PostBaseIndex -> Either PreBaseIndex PostBaseIndex
forall a b. b -> Either a b
Right (PostBaseIndex -> Either PreBaseIndex PostBaseIndex)
-> PostBaseIndex -> Either PreBaseIndex PostBaseIndex
forall a b. (a -> b) -> a -> b
$ Int -> PostBaseIndex
PostBaseIndex (Int
idx Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
bp)
toPreBaseIndex :: AbsoluteIndex -> BasePoint -> PreBaseIndex
toPreBaseIndex :: AbsoluteIndex -> BasePoint -> PreBaseIndex
toPreBaseIndex (AbsoluteIndex Int
idx) (BasePoint Int
bp) =
Int -> PreBaseIndex
PreBaseIndex (Int
bp Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
idx Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
fromPreBaseIndex :: PreBaseIndex -> BasePoint -> AbsoluteIndex
fromPreBaseIndex :: PreBaseIndex -> BasePoint -> AbsoluteIndex
fromPreBaseIndex (PreBaseIndex Int
ri) (BasePoint Int
bp) =
Int -> AbsoluteIndex
AbsoluteIndex (Int
bp Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
ri Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
toPostBaseIndex :: AbsoluteIndex -> BasePoint -> PostBaseIndex
toPostBaseIndex :: AbsoluteIndex -> BasePoint -> PostBaseIndex
toPostBaseIndex (AbsoluteIndex Int
idx) (BasePoint Int
bp) =
Int -> PostBaseIndex
PostBaseIndex (Int
idx Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
bp)
fromPostBaseIndex :: PostBaseIndex -> BasePoint -> AbsoluteIndex
fromPostBaseIndex :: PostBaseIndex -> BasePoint -> AbsoluteIndex
fromPostBaseIndex (PostBaseIndex Int
pix) (BasePoint Int
bp) =
Int -> AbsoluteIndex
AbsoluteIndex (Int
pix Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
bp)
type Setter = Word8 -> Word8
set1
, set01
, set10
, set11
, set001
, set0001
, set0100
, set0101
, set0010
, set00000
, set00001
:: Setter
set1 :: Setter
set1 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
7)
set01 :: Setter
set01 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
6)
set10 :: Setter
set10 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
7)
set11 :: Setter
set11 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
7) Setter -> Setter -> Setter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
6)
set001 :: Setter
set001 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
5)
set0001 :: Setter
set0001 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
4)
set0100 :: Setter
set0100 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
6)
set0101 :: Setter
set0101 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
6) Setter -> Setter -> Setter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
4)
set0010 :: Setter
set0010 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
5)
set00001 :: Setter
set00001 = (Word8 -> Int -> Word8
forall a. Bits a => a -> Int -> a
`setBit` Int
3)
set0, set00, set000, set0000 :: Setter
set0 :: Setter
set0 = Setter
forall a. a -> a
id
set00 :: Setter
set00 = Setter
forall a. a -> a
id
set000 :: Setter
set000 = Setter
forall a. a -> a
id
set0000 :: Setter
set0000 = Setter
forall a. a -> a
id
set00000 :: Setter
set00000 = Setter
forall a. a -> a
id