{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.CompareOp (CompareOp( COMPARE_OP_NEVER
, COMPARE_OP_LESS
, COMPARE_OP_EQUAL
, COMPARE_OP_LESS_OR_EQUAL
, COMPARE_OP_GREATER
, COMPARE_OP_NOT_EQUAL
, COMPARE_OP_GREATER_OR_EQUAL
, COMPARE_OP_ALWAYS
, ..
)) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Zero (Zero)
newtype CompareOp = CompareOp Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern COMPARE_OP_NEVER = CompareOp 0
pattern COMPARE_OP_LESS = CompareOp 1
pattern COMPARE_OP_EQUAL = CompareOp 2
pattern COMPARE_OP_LESS_OR_EQUAL = CompareOp 3
pattern COMPARE_OP_GREATER = CompareOp 4
pattern COMPARE_OP_NOT_EQUAL = CompareOp 5
pattern COMPARE_OP_GREATER_OR_EQUAL = CompareOp 6
pattern COMPARE_OP_ALWAYS = CompareOp 7
{-# complete COMPARE_OP_NEVER,
COMPARE_OP_LESS,
COMPARE_OP_EQUAL,
COMPARE_OP_LESS_OR_EQUAL,
COMPARE_OP_GREATER,
COMPARE_OP_NOT_EQUAL,
COMPARE_OP_GREATER_OR_EQUAL,
COMPARE_OP_ALWAYS :: CompareOp #-}
instance Show CompareOp where
showsPrec p = \case
COMPARE_OP_NEVER -> showString "COMPARE_OP_NEVER"
COMPARE_OP_LESS -> showString "COMPARE_OP_LESS"
COMPARE_OP_EQUAL -> showString "COMPARE_OP_EQUAL"
COMPARE_OP_LESS_OR_EQUAL -> showString "COMPARE_OP_LESS_OR_EQUAL"
COMPARE_OP_GREATER -> showString "COMPARE_OP_GREATER"
COMPARE_OP_NOT_EQUAL -> showString "COMPARE_OP_NOT_EQUAL"
COMPARE_OP_GREATER_OR_EQUAL -> showString "COMPARE_OP_GREATER_OR_EQUAL"
COMPARE_OP_ALWAYS -> showString "COMPARE_OP_ALWAYS"
CompareOp x -> showParen (p >= 11) (showString "CompareOp " . showsPrec 11 x)
instance Read CompareOp where
readPrec = parens (choose [("COMPARE_OP_NEVER", pure COMPARE_OP_NEVER)
, ("COMPARE_OP_LESS", pure COMPARE_OP_LESS)
, ("COMPARE_OP_EQUAL", pure COMPARE_OP_EQUAL)
, ("COMPARE_OP_LESS_OR_EQUAL", pure COMPARE_OP_LESS_OR_EQUAL)
, ("COMPARE_OP_GREATER", pure COMPARE_OP_GREATER)
, ("COMPARE_OP_NOT_EQUAL", pure COMPARE_OP_NOT_EQUAL)
, ("COMPARE_OP_GREATER_OR_EQUAL", pure COMPARE_OP_GREATER_OR_EQUAL)
, ("COMPARE_OP_ALWAYS", pure COMPARE_OP_ALWAYS)]
+++
prec 10 (do
expectP (Ident "CompareOp")
v <- step readPrec
pure (CompareOp v)))