keiro-dsl-0.10.0.0: test/conformance-scalar-expressions/Generated/AggregateScalarExpressions/StructuralProjections.hs
{-# LANGUAGE TypeFamilies #-}
-- @generated by keiro-dsl 0.9.0.0 (language keiro-dsl 4) from context aggregate-scalar-expressions mapped structural facade; do not edit.
-- Equality witnesses are emitted for Text, Int, Bool, Natural, and UTCTime.
-- Int, Natural, and UTCTime belong to Keiki's ordered subset.
module Generated.AggregateScalarExpressions.StructuralProjections
( limitsCeilingWitness
, limitsMinimumWitness
) where
import Data.Text (Text)
import Data.Time (UTCTime)
import Numeric.Natural (Natural)
import Keiro.Codec.Structural (bindingToShape)
import Keiki.Core (FieldProjection (..), FieldWitness, fieldWitness)
import Generated.AggregateScalarExpressions.Structural.Shape.Limits qualified as ShapeLimits
import ScalarExpressions.Bindings qualified as Bindings
import ScalarExpressions.Domain (Limits)
data LimitsCeilingProjection
instance FieldProjection LimitsCeilingProjection where
type FieldName LimitsCeilingProjection = "/ceiling"
type FieldOwner LimitsCeilingProjection = Limits
type FieldResult LimitsCeilingProjection = Natural
fieldShapeId _ = "scalar-expressions.Limits.v1"
projectFieldValue _ owner = ShapeLimits.ceiling (bindingToShape Bindings.limitsBinding owner)
limitsCeilingWitness :: FieldWitness LimitsCeilingProjection
limitsCeilingWitness = fieldWitness @LimitsCeilingProjection
data LimitsMinimumProjection
instance FieldProjection LimitsMinimumProjection where
type FieldName LimitsMinimumProjection = "/minimum"
type FieldOwner LimitsMinimumProjection = Limits
type FieldResult LimitsMinimumProjection = Integer
fieldShapeId _ = "scalar-expressions.Limits.v1"
projectFieldValue _ owner = ShapeLimits.minimum (bindingToShape Bindings.limitsBinding owner)
limitsMinimumWitness :: FieldWitness LimitsMinimumProjection
limitsMinimumWitness = fieldWitness @LimitsMinimumProjection