hydra-ext-0.18.0: src/main/haskell/Hydra/Ext/Dsl/Protobuf/Environment.hs
-- Note: this is an automatically generated file. Do not edit.
-- | DSL functions for hydra.ext.protobuf.environment
module Hydra.Ext.Dsl.Protobuf.Environment where
import qualified Hydra.Core.Model as Model
import qualified Hydra.Core.Typed as Typed
import qualified Hydra.Core.Typing as Typing
import qualified Hydra.Ext.Protobuf.Environment as Environment
import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci
import Data.Void
-- | DSL constructor for hydra.ext.protobuf.environment.EncoderState
encoderState :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Int -> Typed.TypedTerm Environment.EncoderState
encoderState context fieldIndex =
Typed.TypedTerm (Model.TermRecord (Model.Record {
Model.recordTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.recordFields = [
Model.Field {
Model.fieldName = (Model.Name "context"),
Model.fieldTerm = (Typed.unTypedTerm context)},
Model.Field {
Model.fieldName = (Model.Name "fieldIndex"),
Model.fieldTerm = (Typed.unTypedTerm fieldIndex)}]}))
-- | DSL accessor for the context field of hydra.ext.protobuf.environment.EncoderState
encoderStateContext :: Typed.TypedTerm Environment.EncoderState -> Typed.TypedTerm Typing.InferenceContext
encoderStateContext x =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermProject (Model.Projection {
Model.projectionTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.projectionFieldName = (Model.Name "context")})),
Model.applicationArgument = (Typed.unTypedTerm x)}))
-- | DSL name token for hydra.ext.protobuf.environment.EncoderState
encoderStateEncoderState :: Typed.TypedName Environment.EncoderState
encoderStateEncoderState = Typed.TypedName (Model.Name "hydra.ext.protobuf.environment.EncoderState")
-- | DSL accessor for the fieldIndex field of hydra.ext.protobuf.environment.EncoderState
encoderStateFieldIndex :: Typed.TypedTerm Environment.EncoderState -> Typed.TypedTerm Int
encoderStateFieldIndex x =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermProject (Model.Projection {
Model.projectionTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.projectionFieldName = (Model.Name "fieldIndex")})),
Model.applicationArgument = (Typed.unTypedTerm x)}))
-- | DSL updater for the context field of hydra.ext.protobuf.environment.EncoderState
encoderStateWithContext :: Typed.TypedTerm Environment.EncoderState -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Environment.EncoderState
encoderStateWithContext original newVal =
Typed.TypedTerm (Model.TermRecord (Model.Record {
Model.recordTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.recordFields = [
Model.Field {
Model.fieldName = (Model.Name "context"),
Model.fieldTerm = (Typed.unTypedTerm newVal)},
Model.Field {
Model.fieldName = (Model.Name "fieldIndex"),
Model.fieldTerm = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermProject (Model.Projection {
Model.projectionTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.projectionFieldName = (Model.Name "fieldIndex")})),
Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
-- | DSL updater for the fieldIndex field of hydra.ext.protobuf.environment.EncoderState
encoderStateWithFieldIndex :: Typed.TypedTerm Environment.EncoderState -> Typed.TypedTerm Int -> Typed.TypedTerm Environment.EncoderState
encoderStateWithFieldIndex original newVal =
Typed.TypedTerm (Model.TermRecord (Model.Record {
Model.recordTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.recordFields = [
Model.Field {
Model.fieldName = (Model.Name "context"),
Model.fieldTerm = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermProject (Model.Projection {
Model.projectionTypeName = (Model.Name "hydra.ext.protobuf.environment.EncoderState"),
Model.projectionFieldName = (Model.Name "context")})),
Model.applicationArgument = (Typed.unTypedTerm original)}))},
Model.Field {
Model.fieldName = (Model.Name "fieldIndex"),
Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))
-- | DSL injection for the either variant of hydra.ext.protobuf.environment.StructuralTypeRef
structuralTypeRefEither :: Typed.TypedTerm (Model.Type, Model.Type) -> Typed.TypedTerm Environment.StructuralTypeRef
structuralTypeRefEither x =
Typed.TypedTerm (Model.TermInject (Model.Injection {
Model.injectionTypeName = (Model.Name "hydra.ext.protobuf.environment.StructuralTypeRef"),
Model.injectionField = Model.Field {
Model.fieldName = (Model.Name "either"),
Model.fieldTerm = (Typed.unTypedTerm x)}}))
-- | DSL injection for the pair variant of hydra.ext.protobuf.environment.StructuralTypeRef
structuralTypeRefPair :: Typed.TypedTerm (Model.Type, Model.Type) -> Typed.TypedTerm Environment.StructuralTypeRef
structuralTypeRefPair x =
Typed.TypedTerm (Model.TermInject (Model.Injection {
Model.injectionTypeName = (Model.Name "hydra.ext.protobuf.environment.StructuralTypeRef"),
Model.injectionField = Model.Field {
Model.fieldName = (Model.Name "pair"),
Model.fieldTerm = (Typed.unTypedTerm x)}}))
-- | DSL name token for hydra.ext.protobuf.environment.StructuralTypeRef
structuralTypeRefStructuralTypeRef :: Typed.TypedName Environment.StructuralTypeRef
structuralTypeRefStructuralTypeRef = Typed.TypedName (Model.Name "hydra.ext.protobuf.environment.StructuralTypeRef")