module E2ASM.Assembler.Predicate
( Predicate
, mkPredicate
, p0
) where


import qualified Data.Word as W


data Predicate
  = Predicate W.Word8
  deriving (Eq, Show)


maxPredicate :: Integral n => n
maxPredicate = 8


mkPredicate :: Integral n => n -> Maybe Predicate
mkPredicate n =
  if n < maxPredicate then
    Just $ Predicate (fromIntegral n)
  else
    Nothing


p0 :: Predicate
p0 = Predicate 0
