{-# LANGUAGE TemplateHaskell #-}

module Rattletrap.Type.CompressedWord
  ( CompressedWord(..)
  )
where

import Rattletrap.Type.Common

-- | Although there's no guarantee that these values will not overflow, it's
-- exceptionally unlikely. Most 'CompressedWord's are very small.
data CompressedWord = CompressedWord
  { CompressedWord -> Word
compressedWordLimit :: Word
  , CompressedWord -> Word
compressedWordValue :: Word
  } deriving (CompressedWord -> CompressedWord -> Bool
(CompressedWord -> CompressedWord -> Bool)
-> (CompressedWord -> CompressedWord -> Bool) -> Eq CompressedWord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompressedWord -> CompressedWord -> Bool
$c/= :: CompressedWord -> CompressedWord -> Bool
== :: CompressedWord -> CompressedWord -> Bool
$c== :: CompressedWord -> CompressedWord -> Bool
Eq, Eq CompressedWord
Eq CompressedWord
-> (CompressedWord -> CompressedWord -> Ordering)
-> (CompressedWord -> CompressedWord -> Bool)
-> (CompressedWord -> CompressedWord -> Bool)
-> (CompressedWord -> CompressedWord -> Bool)
-> (CompressedWord -> CompressedWord -> Bool)
-> (CompressedWord -> CompressedWord -> CompressedWord)
-> (CompressedWord -> CompressedWord -> CompressedWord)
-> Ord CompressedWord
CompressedWord -> CompressedWord -> Bool
CompressedWord -> CompressedWord -> Ordering
CompressedWord -> CompressedWord -> CompressedWord
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
min :: CompressedWord -> CompressedWord -> CompressedWord
$cmin :: CompressedWord -> CompressedWord -> CompressedWord
max :: CompressedWord -> CompressedWord -> CompressedWord
$cmax :: CompressedWord -> CompressedWord -> CompressedWord
>= :: CompressedWord -> CompressedWord -> Bool
$c>= :: CompressedWord -> CompressedWord -> Bool
> :: CompressedWord -> CompressedWord -> Bool
$c> :: CompressedWord -> CompressedWord -> Bool
<= :: CompressedWord -> CompressedWord -> Bool
$c<= :: CompressedWord -> CompressedWord -> Bool
< :: CompressedWord -> CompressedWord -> Bool
$c< :: CompressedWord -> CompressedWord -> Bool
compare :: CompressedWord -> CompressedWord -> Ordering
$ccompare :: CompressedWord -> CompressedWord -> Ordering
$cp1Ord :: Eq CompressedWord
Ord, Int -> CompressedWord -> ShowS
[CompressedWord] -> ShowS
CompressedWord -> String
(Int -> CompressedWord -> ShowS)
-> (CompressedWord -> String)
-> ([CompressedWord] -> ShowS)
-> Show CompressedWord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompressedWord] -> ShowS
$cshowList :: [CompressedWord] -> ShowS
show :: CompressedWord -> String
$cshow :: CompressedWord -> String
showsPrec :: Int -> CompressedWord -> ShowS
$cshowsPrec :: Int -> CompressedWord -> ShowS
Show)

$(deriveJson ''CompressedWord)