{-# Language TemplateHaskell #-}
module Language.Drasil.Chunk.Constrained (
ConstrainedChunk(..), cuc, cvc, cnstrw,
ConstrConcept(..),
cnstrw', constrained', constrainedNRV', cuc', cuc'') where
import Control.Lens ((^.), makeLenses, view)
import Language.Drasil.Chunk.Concept (cw, dcc)
import Language.Drasil.Chunk.DefinedQuantity (DefinedQuantityDict, dqd, dqd', dqdWr)
import Language.Drasil.Chunk.Quantity (QuantityDict, qw, vc)
import Language.Drasil.Chunk.Unital (uc')
import Language.Drasil.Chunk.Unitary (unitary)
import Language.Drasil.Symbol (HasSymbol(..), Symbol)
import Language.Drasil.Classes (NamedIdea(term), Idea(getA), Express(express),
Definition(defn), ConceptDomain(cdom), Concept, Quantity,
IsUnit, Constrained(constraints), HasReasVal(reasVal))
import Language.Drasil.Constraint (ConstraintE)
import Language.Drasil.Chunk.UnitDefn (unitWrapper, MayHaveUnit(getUnit))
import Language.Drasil.Expr.Lang (Expr(..))
import Language.Drasil.Expr.Class (sy)
import Language.Drasil.NounPhrase.Core (NP)
import Language.Drasil.Sentence (Sentence(S))
import Language.Drasil.Space (Space, HasSpace(..))
import Language.Drasil.Stages (Stage)
import Language.Drasil.UID (HasUID(..))
data ConstrainedChunk = ConstrainedChunk { ConstrainedChunk -> QuantityDict
_qd :: QuantityDict
, ConstrainedChunk -> [ConstraintE]
_constr :: [ConstraintE]
, ConstrainedChunk -> Maybe Expr
_reasV :: Maybe Expr
}
makeLenses ''ConstrainedChunk
instance HasUID ConstrainedChunk where uid :: Getter ConstrainedChunk UID
uid = (QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk
Lens' ConstrainedChunk QuantityDict
qd ((QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk)
-> ((UID -> f UID) -> QuantityDict -> f QuantityDict)
-> (UID -> f UID)
-> ConstrainedChunk
-> f ConstrainedChunk
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UID -> f UID) -> QuantityDict -> f QuantityDict
forall c. HasUID c => Getter c UID
Getter QuantityDict UID
uid
instance NamedIdea ConstrainedChunk where term :: Lens' ConstrainedChunk NP
term = (QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk
Lens' ConstrainedChunk QuantityDict
qd ((QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk)
-> ((NP -> f NP) -> QuantityDict -> f QuantityDict)
-> (NP -> f NP)
-> ConstrainedChunk
-> f ConstrainedChunk
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NP -> f NP) -> QuantityDict -> f QuantityDict
forall c. NamedIdea c => Lens' c NP
Lens' QuantityDict NP
term
instance Idea ConstrainedChunk where getA :: ConstrainedChunk -> Maybe String
getA = QuantityDict -> Maybe String
forall c. Idea c => c -> Maybe String
getA (QuantityDict -> Maybe String)
-> (ConstrainedChunk -> QuantityDict)
-> ConstrainedChunk
-> Maybe String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting QuantityDict ConstrainedChunk QuantityDict
-> ConstrainedChunk -> QuantityDict
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting QuantityDict ConstrainedChunk QuantityDict
Lens' ConstrainedChunk QuantityDict
qd
instance HasSpace ConstrainedChunk where typ :: Getter ConstrainedChunk Space
typ = (QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk
Lens' ConstrainedChunk QuantityDict
qd ((QuantityDict -> f QuantityDict)
-> ConstrainedChunk -> f ConstrainedChunk)
-> ((Space -> f Space) -> QuantityDict -> f QuantityDict)
-> (Space -> f Space)
-> ConstrainedChunk
-> f ConstrainedChunk
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Space -> f Space) -> QuantityDict -> f QuantityDict
forall c. HasSpace c => Getter c Space
Getter QuantityDict Space
typ
instance HasSymbol ConstrainedChunk where symbol :: ConstrainedChunk -> Stage -> Symbol
symbol ConstrainedChunk
c = QuantityDict -> Stage -> Symbol
forall c. HasSymbol c => c -> Stage -> Symbol
symbol (ConstrainedChunk
cConstrainedChunk
-> Getting QuantityDict ConstrainedChunk QuantityDict
-> QuantityDict
forall s a. s -> Getting a s a -> a
^.Getting QuantityDict ConstrainedChunk QuantityDict
Lens' ConstrainedChunk QuantityDict
qd)
instance Quantity ConstrainedChunk where
instance Constrained ConstrainedChunk where constraints :: Lens' ConstrainedChunk [ConstraintE]
constraints = ([ConstraintE] -> f [ConstraintE])
-> ConstrainedChunk -> f ConstrainedChunk
Lens' ConstrainedChunk [ConstraintE]
constr
instance HasReasVal ConstrainedChunk where reasVal :: Lens' ConstrainedChunk (Maybe Expr)
reasVal = (Maybe Expr -> f (Maybe Expr))
-> ConstrainedChunk -> f ConstrainedChunk
Lens' ConstrainedChunk (Maybe Expr)
reasV
instance Eq ConstrainedChunk where ConstrainedChunk
c1 == :: ConstrainedChunk -> ConstrainedChunk -> Bool
== ConstrainedChunk
c2 = (ConstrainedChunk
c1 ConstrainedChunk -> Getting UID ConstrainedChunk UID -> UID
forall s a. s -> Getting a s a -> a
^. (QuantityDict -> Const UID QuantityDict)
-> ConstrainedChunk -> Const UID ConstrainedChunk
Lens' ConstrainedChunk QuantityDict
qd ((QuantityDict -> Const UID QuantityDict)
-> ConstrainedChunk -> Const UID ConstrainedChunk)
-> ((UID -> Const UID UID)
-> QuantityDict -> Const UID QuantityDict)
-> Getting UID ConstrainedChunk UID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UID -> Const UID UID) -> QuantityDict -> Const UID QuantityDict
forall c. HasUID c => Getter c UID
Getter QuantityDict UID
uid) UID -> UID -> Bool
forall a. Eq a => a -> a -> Bool
== (ConstrainedChunk
c2 ConstrainedChunk -> Getting UID ConstrainedChunk UID -> UID
forall s a. s -> Getting a s a -> a
^. (QuantityDict -> Const UID QuantityDict)
-> ConstrainedChunk -> Const UID ConstrainedChunk
Lens' ConstrainedChunk QuantityDict
qd ((QuantityDict -> Const UID QuantityDict)
-> ConstrainedChunk -> Const UID ConstrainedChunk)
-> ((UID -> Const UID UID)
-> QuantityDict -> Const UID QuantityDict)
-> Getting UID ConstrainedChunk UID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UID -> Const UID UID) -> QuantityDict -> Const UID QuantityDict
forall c. HasUID c => Getter c UID
Getter QuantityDict UID
uid)
instance MayHaveUnit ConstrainedChunk where getUnit :: ConstrainedChunk -> Maybe UnitDefn
getUnit = QuantityDict -> Maybe UnitDefn
forall u. MayHaveUnit u => u -> Maybe UnitDefn
getUnit (QuantityDict -> Maybe UnitDefn)
-> (ConstrainedChunk -> QuantityDict)
-> ConstrainedChunk
-> Maybe UnitDefn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting QuantityDict ConstrainedChunk QuantityDict
-> ConstrainedChunk -> QuantityDict
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting QuantityDict ConstrainedChunk QuantityDict
Lens' ConstrainedChunk QuantityDict
qd
cuc :: (IsUnit u) => String -> NP -> Symbol -> u
-> Space -> [ConstraintE] -> Expr -> ConstrainedChunk
cuc :: forall u.
IsUnit u =>
String
-> NP
-> Symbol
-> u
-> Space
-> [ConstraintE]
-> Expr
-> ConstrainedChunk
cuc String
i NP
t Symbol
s u
u Space
space [ConstraintE]
cs Expr
rv = QuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrainedChunk
ConstrainedChunk (UnitaryChunk -> QuantityDict
forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw (String -> NP -> Symbol -> u -> Space -> UnitaryChunk
forall u.
IsUnit u =>
String -> NP -> Symbol -> u -> Space -> UnitaryChunk
unitary String
i NP
t Symbol
s u
u Space
space)) [ConstraintE]
cs (Expr -> Maybe Expr
forall a. a -> Maybe a
Just Expr
rv)
cvc :: String -> NP -> Symbol -> Space -> [ConstraintE] -> Maybe Expr -> ConstrainedChunk
cvc :: String
-> NP
-> Symbol
-> Space
-> [ConstraintE]
-> Maybe Expr
-> ConstrainedChunk
cvc String
i NP
des Symbol
sym Space
space = QuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrainedChunk
ConstrainedChunk (QuantityDict -> QuantityDict
forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw (String -> NP -> Symbol -> Space -> QuantityDict
vc String
i NP
des Symbol
sym Space
space))
cnstrw :: (Quantity c, Constrained c, HasReasVal c, MayHaveUnit c) => c -> ConstrainedChunk
cnstrw :: forall c.
(Quantity c, Constrained c, HasReasVal c, MayHaveUnit c) =>
c -> ConstrainedChunk
cnstrw c
c = QuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrainedChunk
ConstrainedChunk (c -> QuantityDict
forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw c
c) (c
c c -> Getting [ConstraintE] c [ConstraintE] -> [ConstraintE]
forall s a. s -> Getting a s a -> a
^. Getting [ConstraintE] c [ConstraintE]
forall c. Constrained c => Lens' c [ConstraintE]
Lens' c [ConstraintE]
constraints) (c
c c -> Getting (Maybe Expr) c (Maybe Expr) -> Maybe Expr
forall s a. s -> Getting a s a -> a
^. Getting (Maybe Expr) c (Maybe Expr)
forall c. HasReasVal c => Lens' c (Maybe Expr)
Lens' c (Maybe Expr)
reasVal)
data ConstrConcept = ConstrConcept { ConstrConcept -> DefinedQuantityDict
_defq :: DefinedQuantityDict
, ConstrConcept -> [ConstraintE]
_constr' :: [ConstraintE]
, ConstrConcept -> Maybe Expr
_reasV' :: Maybe Expr
}
makeLenses ''ConstrConcept
instance HasUID ConstrConcept where uid :: Getter ConstrConcept UID
uid = (DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq ((DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept)
-> ((UID -> f UID) -> DefinedQuantityDict -> f DefinedQuantityDict)
-> (UID -> f UID)
-> ConstrConcept
-> f ConstrConcept
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UID -> f UID) -> DefinedQuantityDict -> f DefinedQuantityDict
forall c. HasUID c => Getter c UID
Getter DefinedQuantityDict UID
uid
instance NamedIdea ConstrConcept where term :: Lens' ConstrConcept NP
term = (DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq ((DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept)
-> ((NP -> f NP) -> DefinedQuantityDict -> f DefinedQuantityDict)
-> (NP -> f NP)
-> ConstrConcept
-> f ConstrConcept
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NP -> f NP) -> DefinedQuantityDict -> f DefinedQuantityDict
forall c. NamedIdea c => Lens' c NP
Lens' DefinedQuantityDict NP
term
instance Idea ConstrConcept where getA :: ConstrConcept -> Maybe String
getA = DefinedQuantityDict -> Maybe String
forall c. Idea c => c -> Maybe String
getA (DefinedQuantityDict -> Maybe String)
-> (ConstrConcept -> DefinedQuantityDict)
-> ConstrConcept
-> Maybe String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
-> ConstrConcept -> DefinedQuantityDict
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
Lens' ConstrConcept DefinedQuantityDict
defq
instance HasSpace ConstrConcept where typ :: Getter ConstrConcept Space
typ = (DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq ((DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept)
-> ((Space -> f Space)
-> DefinedQuantityDict -> f DefinedQuantityDict)
-> (Space -> f Space)
-> ConstrConcept
-> f ConstrConcept
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Space -> f Space) -> DefinedQuantityDict -> f DefinedQuantityDict
forall c. HasSpace c => Getter c Space
Getter DefinedQuantityDict Space
typ
instance HasSymbol ConstrConcept where symbol :: ConstrConcept -> Stage -> Symbol
symbol ConstrConcept
c = DefinedQuantityDict -> Stage -> Symbol
forall c. HasSymbol c => c -> Stage -> Symbol
symbol (ConstrConcept
cConstrConcept
-> Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
-> DefinedQuantityDict
forall s a. s -> Getting a s a -> a
^.Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
Lens' ConstrConcept DefinedQuantityDict
defq)
instance Quantity ConstrConcept where
instance Definition ConstrConcept where defn :: Lens' ConstrConcept Sentence
defn = (DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq ((DefinedQuantityDict -> f DefinedQuantityDict)
-> ConstrConcept -> f ConstrConcept)
-> ((Sentence -> f Sentence)
-> DefinedQuantityDict -> f DefinedQuantityDict)
-> (Sentence -> f Sentence)
-> ConstrConcept
-> f ConstrConcept
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Sentence -> f Sentence)
-> DefinedQuantityDict -> f DefinedQuantityDict
forall c. Definition c => Lens' c Sentence
Lens' DefinedQuantityDict Sentence
defn
instance ConceptDomain ConstrConcept where cdom :: ConstrConcept -> [UID]
cdom = DefinedQuantityDict -> [UID]
forall c. ConceptDomain c => c -> [UID]
cdom (DefinedQuantityDict -> [UID])
-> (ConstrConcept -> DefinedQuantityDict) -> ConstrConcept -> [UID]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
-> ConstrConcept -> DefinedQuantityDict
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
Lens' ConstrConcept DefinedQuantityDict
defq
instance Constrained ConstrConcept where constraints :: Lens' ConstrConcept [ConstraintE]
constraints = ([ConstraintE] -> f [ConstraintE])
-> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept [ConstraintE]
constr'
instance HasReasVal ConstrConcept where reasVal :: Lens' ConstrConcept (Maybe Expr)
reasVal = (Maybe Expr -> f (Maybe Expr)) -> ConstrConcept -> f ConstrConcept
Lens' ConstrConcept (Maybe Expr)
reasV'
instance Eq ConstrConcept where ConstrConcept
c1 == :: ConstrConcept -> ConstrConcept -> Bool
== ConstrConcept
c2 = (ConstrConcept
c1 ConstrConcept -> Getting UID ConstrConcept UID -> UID
forall s a. s -> Getting a s a -> a
^.(DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> ConstrConcept -> Const UID ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq((DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> ConstrConcept -> Const UID ConstrConcept)
-> ((UID -> Const UID UID)
-> DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> Getting UID ConstrConcept UID
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(UID -> Const UID UID)
-> DefinedQuantityDict -> Const UID DefinedQuantityDict
forall c. HasUID c => Getter c UID
Getter DefinedQuantityDict UID
uid) UID -> UID -> Bool
forall a. Eq a => a -> a -> Bool
== (ConstrConcept
c2 ConstrConcept -> Getting UID ConstrConcept UID -> UID
forall s a. s -> Getting a s a -> a
^.(DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> ConstrConcept -> Const UID ConstrConcept
Lens' ConstrConcept DefinedQuantityDict
defq((DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> ConstrConcept -> Const UID ConstrConcept)
-> ((UID -> Const UID UID)
-> DefinedQuantityDict -> Const UID DefinedQuantityDict)
-> Getting UID ConstrConcept UID
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(UID -> Const UID UID)
-> DefinedQuantityDict -> Const UID DefinedQuantityDict
forall c. HasUID c => Getter c UID
Getter DefinedQuantityDict UID
uid)
instance MayHaveUnit ConstrConcept where getUnit :: ConstrConcept -> Maybe UnitDefn
getUnit = DefinedQuantityDict -> Maybe UnitDefn
forall u. MayHaveUnit u => u -> Maybe UnitDefn
getUnit (DefinedQuantityDict -> Maybe UnitDefn)
-> (ConstrConcept -> DefinedQuantityDict)
-> ConstrConcept
-> Maybe UnitDefn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
-> ConstrConcept -> DefinedQuantityDict
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting DefinedQuantityDict ConstrConcept DefinedQuantityDict
Lens' ConstrConcept DefinedQuantityDict
defq
instance Express ConstrConcept where express :: ConstrConcept -> ModelExpr
express = ConstrConcept -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy
constrained' :: (Concept c, MayHaveUnit c, Quantity c) =>
c -> [ConstraintE] -> Expr -> ConstrConcept
constrained' :: forall c.
(Concept c, MayHaveUnit c, Quantity c) =>
c -> [ConstraintE] -> Expr -> ConstrConcept
constrained' c
q [ConstraintE]
cs Expr
rv = DefinedQuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrConcept
ConstrConcept (c -> DefinedQuantityDict
forall c.
(Quantity c, Concept c, MayHaveUnit c) =>
c -> DefinedQuantityDict
dqdWr c
q) [ConstraintE]
cs (Expr -> Maybe Expr
forall a. a -> Maybe a
Just Expr
rv)
constrainedNRV' :: (Concept c, MayHaveUnit c, Quantity c) =>
c -> [ConstraintE] -> ConstrConcept
constrainedNRV' :: forall c.
(Concept c, MayHaveUnit c, Quantity c) =>
c -> [ConstraintE] -> ConstrConcept
constrainedNRV' c
q [ConstraintE]
cs = DefinedQuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrConcept
ConstrConcept (c -> DefinedQuantityDict
forall c.
(Quantity c, Concept c, MayHaveUnit c) =>
c -> DefinedQuantityDict
dqdWr c
q) [ConstraintE]
cs Maybe Expr
forall a. Maybe a
Nothing
cuc' :: (IsUnit u) => String -> NP -> String -> Symbol -> u
-> Space -> [ConstraintE] -> Expr -> ConstrConcept
cuc' :: forall u.
IsUnit u =>
String
-> NP
-> String
-> Symbol
-> u
-> Space
-> [ConstraintE]
-> Expr
-> ConstrConcept
cuc' String
nam NP
trm String
desc Symbol
sym u
un Space
space [ConstraintE]
cs Expr
rv =
DefinedQuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrConcept
ConstrConcept (ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
forall u.
IsUnit u =>
ConceptChunk -> Symbol -> Space -> u -> DefinedQuantityDict
dqd (UnitalChunk -> ConceptChunk
forall c. Concept c => c -> ConceptChunk
cw (String -> NP -> Sentence -> Symbol -> Space -> u -> UnitalChunk
forall u.
IsUnit u =>
String -> NP -> Sentence -> Symbol -> Space -> u -> UnitalChunk
uc' String
nam NP
trm (String -> Sentence
S String
desc) Symbol
sym Space
space u
un)) Symbol
sym Space
space UnitDefn
uu) [ConstraintE]
cs (Expr -> Maybe Expr
forall a. a -> Maybe a
Just Expr
rv)
where uu :: UnitDefn
uu = u -> UnitDefn
forall u. IsUnit u => u -> UnitDefn
unitWrapper u
un
cuc'' :: (IsUnit u) => String -> NP -> String -> (Stage -> Symbol) -> u
-> Space -> [ConstraintE] -> Expr -> ConstrConcept
cuc'' :: forall u.
IsUnit u =>
String
-> NP
-> String
-> (Stage -> Symbol)
-> u
-> Space
-> [ConstraintE]
-> Expr
-> ConstrConcept
cuc'' String
nam NP
trm String
desc Stage -> Symbol
sym u
un Space
space [ConstraintE]
cs Expr
rv =
DefinedQuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrConcept
ConstrConcept (ConceptChunk
-> (Stage -> Symbol)
-> Space
-> Maybe UnitDefn
-> DefinedQuantityDict
dqd' (String -> NP -> String -> ConceptChunk
dcc String
nam NP
trm String
desc) Stage -> Symbol
sym Space
space (UnitDefn -> Maybe UnitDefn
forall a. a -> Maybe a
Just UnitDefn
uu)) [ConstraintE]
cs (Expr -> Maybe Expr
forall a. a -> Maybe a
Just Expr
rv)
where uu :: UnitDefn
uu = u -> UnitDefn
forall u. IsUnit u => u -> UnitDefn
unitWrapper u
un
cnstrw' :: (Quantity c, Concept c, Constrained c, HasReasVal c, MayHaveUnit c) => c -> ConstrConcept
cnstrw' :: forall c.
(Quantity c, Concept c, Constrained c, HasReasVal c,
MayHaveUnit c) =>
c -> ConstrConcept
cnstrw' c
c = DefinedQuantityDict -> [ConstraintE] -> Maybe Expr -> ConstrConcept
ConstrConcept (c -> DefinedQuantityDict
forall c.
(Quantity c, Concept c, MayHaveUnit c) =>
c -> DefinedQuantityDict
dqdWr c
c) (c
c c -> Getting [ConstraintE] c [ConstraintE] -> [ConstraintE]
forall s a. s -> Getting a s a -> a
^. Getting [ConstraintE] c [ConstraintE]
forall c. Constrained c => Lens' c [ConstraintE]
Lens' c [ConstraintE]
constraints) (c
c c -> Getting (Maybe Expr) c (Maybe Expr) -> Maybe Expr
forall s a. s -> Getting a s a -> a
^. Getting (Maybe Expr) c (Maybe Expr)
forall c. HasReasVal c => Lens' c (Maybe Expr)
Lens' c (Maybe Expr)
reasVal)