{-# Language GADTs #-}
module Language.Drasil.Constraint (
Constraint(..), ConstraintE, ConstraintReason(..),
physc, sfwrc, isPhysC, isSfwrC
) where
import Language.Drasil.Expr.Lang
import Language.Drasil.Space (RealInterval(..))
data ConstraintReason = Physical | Software
type ConstraintE = Constraint Expr
data Constraint a where
Range :: ConstraintReason -> RealInterval a a -> Constraint a
physc :: RealInterval Expr Expr -> ConstraintE
physc :: RealInterval Expr Expr -> ConstraintE
physc = ConstraintReason -> RealInterval Expr Expr -> ConstraintE
forall a. ConstraintReason -> RealInterval a a -> Constraint a
Range ConstraintReason
Physical
sfwrc :: RealInterval Expr Expr -> ConstraintE
sfwrc :: RealInterval Expr Expr -> ConstraintE
sfwrc = ConstraintReason -> RealInterval Expr Expr -> ConstraintE
forall a. ConstraintReason -> RealInterval a a -> Constraint a
Range ConstraintReason
Software
isPhysC, isSfwrC :: Constraint e -> Bool
isPhysC :: Constraint e -> Bool
isPhysC (Range Physical _) = Bool
True
isPhysC _ = Bool
False
isSfwrC :: Constraint e -> Bool
isSfwrC (Range Software _) = Bool
True
isSfwrC _ = Bool
False