packages feed

hydra-kernel-0.18.0: src/main/haskell/Hydra/Core/Dsl/Diff.hs

-- Note: this is an automatically generated file. Do not edit.

-- | DSL functions for hydra.core.diff

module Hydra.Core.Dsl.Diff where

import qualified Hydra.Core.Decode.Diff as DecodeDiff
import qualified Hydra.Core.Diff as Diff
import qualified Hydra.Core.Dsl.Model as DslModel
import qualified Hydra.Core.Encode.Diff as EncodeDiff
import qualified Hydra.Core.Errors as Errors
import qualified Hydra.Core.Graph as Graph
import qualified Hydra.Core.Model as Model
import qualified Hydra.Core.Typed as Typed
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci
import Data.Void
import qualified Data.Map as M

-- | DSL composition builder for the decoder of hydra.core.diff.Edit
decodeEdit :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Edit a s))
decodeEdit a s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.edit")),
        Model.applicationArgument = (Typed.unTypedTerm a)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.Fill
decodeFill :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Fill v))
decodeFill v =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.fill")),
      Model.applicationArgument = (Typed.unTypedTerm v)}))

-- | DSL composition builder for the decoder of hydra.core.diff.Hole
decodeHole :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Hole t s))
decodeHole t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.hole")),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.HoleFiller
decodeHoleFiller :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.HoleFiller v s))
decodeHoleFiller v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.holeFiller")),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.InvalidFillError
decodeInvalidFillError :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.InvalidFillError t v s))
decodeInvalidFillError t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.invalidFillError")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.MigrationError
decodeMigrationError :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationError t v s))
decodeMigrationError t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrationError")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.MigrationPlan
decodeMigrationPlan :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationPlan n t s))
decodeMigrationPlan n t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrationPlan")),
          Model.applicationArgument = (Typed.unTypedTerm n)})),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.Migrator
decodeMigrator :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Migrator t v s))
decodeMigrator t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrator")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.Mistyped
decodeMistyped :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Mistyped t v))
decodeMistyped t v =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.mistyped")),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm v)}))

-- | DSL composition builder for the decoder of hydra.core.diff.SchemaHole
decodeSchemaHole :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.SchemaHole n t s))
decodeSchemaHole n t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.schemaHole")),
          Model.applicationArgument = (Typed.unTypedTerm n)})),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the decoder of hydra.core.diff.StepEdit
decodeStepEdit :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.StepEdit a s))
decodeStepEdit a s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.stepEdit")),
        Model.applicationArgument = (Typed.unTypedTerm a)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL injection for the delete variant of hydra.core.diff.Edit
editDelete :: Typed.TypedTerm (Diff.Edit a s)
editDelete =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "delete"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the descend variant of hydra.core.diff.Edit
editDescend :: Typed.TypedTerm [Diff.StepEdit a s] -> Typed.TypedTerm (Diff.Edit a s)
editDescend x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "descend"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.core.diff.Edit
editEdit :: Typed.TypedName (Diff.Edit a s)
editEdit = Typed.TypedName (Model.Name "hydra.core.diff.Edit")

-- | DSL injection for the retain variant of hydra.core.diff.Edit
editRetain :: Typed.TypedTerm (Diff.Edit a s)
editRetain =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "retain"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the set variant of hydra.core.diff.Edit
editSet :: Typed.TypedTerm a -> Typed.TypedTerm (Diff.Edit a s)
editSet x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "set"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL composition builder for the encoder of hydra.core.diff.Edit
encodeEdit :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Edit a s -> Model.Term)
encodeEdit a s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.edit")),
        Model.applicationArgument = (Typed.unTypedTerm a)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.Fill
encodeFill :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Diff.Fill v -> Model.Term)
encodeFill v =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.fill")),
      Model.applicationArgument = (Typed.unTypedTerm v)}))

-- | DSL composition builder for the encoder of hydra.core.diff.Hole
encodeHole :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Hole t s -> Model.Term)
encodeHole t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.hole")),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.HoleFiller
encodeHoleFiller :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.HoleFiller v s -> Model.Term)
encodeHoleFiller v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.holeFiller")),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.InvalidFillError
encodeInvalidFillError :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.InvalidFillError t v s -> Model.Term)
encodeInvalidFillError t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.invalidFillError")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.MigrationError
encodeMigrationError :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.MigrationError t v s -> Model.Term)
encodeMigrationError t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrationError")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.MigrationPlan
encodeMigrationPlan :: Typed.TypedTerm (n -> Model.Term) -> Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.MigrationPlan n t s -> Model.Term)
encodeMigrationPlan n t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrationPlan")),
          Model.applicationArgument = (Typed.unTypedTerm n)})),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.Migrator
encodeMigrator :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Migrator t v s -> Model.Term)
encodeMigrator t v s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrator")),
          Model.applicationArgument = (Typed.unTypedTerm t)})),
        Model.applicationArgument = (Typed.unTypedTerm v)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.Mistyped
encodeMistyped :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Diff.Mistyped t v -> Model.Term)
encodeMistyped t v =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.mistyped")),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm v)}))

-- | DSL composition builder for the encoder of hydra.core.diff.SchemaHole
encodeSchemaHole :: Typed.TypedTerm (n -> Model.Term) -> Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.SchemaHole n t s -> Model.Term)
encodeSchemaHole n t s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermApplication (Model.Application {
          Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.schemaHole")),
          Model.applicationArgument = (Typed.unTypedTerm n)})),
        Model.applicationArgument = (Typed.unTypedTerm t)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL composition builder for the encoder of hydra.core.diff.StepEdit
encodeStepEdit :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.StepEdit a s -> Model.Term)
encodeStepEdit a s =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermApplication (Model.Application {
        Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.stepEdit")),
        Model.applicationArgument = (Typed.unTypedTerm a)})),
      Model.applicationArgument = (Typed.unTypedTerm s)}))

-- | DSL injection for the defer variant of hydra.core.diff.Fill
fillDefer :: Typed.TypedTerm (Diff.Fill v)
fillDefer =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Fill"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "defer"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL name token for hydra.core.diff.Fill
fillFill :: Typed.TypedName (Diff.Fill v)
fillFill = Typed.TypedName (Model.Name "hydra.core.diff.Fill")

-- | DSL injection for the fillNow variant of hydra.core.diff.Fill
fillFillNow :: Typed.TypedTerm (v -> v) -> Typed.TypedTerm (Diff.Fill v)
fillFillNow x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.Fill"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "fillNow"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.core.diff.Hole
hole :: Typed.TypedTerm [s] -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Hole t s)
hole path type_ =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Typed.unTypedTerm path)},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm type_)}]}))

-- | DSL constructor for hydra.core.diff.HoleFiller
holeFiller :: Typed.TypedTerm [s] -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.HoleFiller v s)
holeFiller path value =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Typed.unTypedTerm path)},
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Typed.unTypedTerm value)}]}))

-- | DSL name token for hydra.core.diff.HoleFiller
holeFillerHoleFiller :: Typed.TypedName (Diff.HoleFiller v s)
holeFillerHoleFiller = Typed.TypedName (Model.Name "hydra.core.diff.HoleFiller")

-- | DSL accessor for the path field of hydra.core.diff.HoleFiller
holeFillerPath :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm [s]
holeFillerPath x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
        Model.projectionFieldName = (Model.Name "path")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the value field of hydra.core.diff.HoleFiller
holeFillerValue :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm v
holeFillerValue x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
        Model.projectionFieldName = (Model.Name "value")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the path field of hydra.core.diff.HoleFiller
holeFillerWithPath :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm [s] -> Typed.TypedTerm (Diff.HoleFiller v s)
holeFillerWithPath original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
              Model.projectionFieldName = (Model.Name "value")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the value field of hydra.core.diff.HoleFiller
holeFillerWithValue :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.HoleFiller v s)
holeFillerWithValue original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),
              Model.projectionFieldName = (Model.Name "path")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL name token for hydra.core.diff.Hole
holeHole :: Typed.TypedName (Diff.Hole t s)
holeHole = Typed.TypedName (Model.Name "hydra.core.diff.Hole")

-- | DSL accessor for the path field of hydra.core.diff.Hole
holePath :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm [s]
holePath x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),
        Model.projectionFieldName = (Model.Name "path")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the type field of hydra.core.diff.Hole
holeType :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm t
holeType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),
        Model.projectionFieldName = (Model.Name "type")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the path field of hydra.core.diff.Hole
holeWithPath :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm [s] -> Typed.TypedTerm (Diff.Hole t s)
holeWithPath original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the type field of hydra.core.diff.Hole
holeWithType :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Hole t s)
holeWithType original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "path"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),
              Model.projectionFieldName = (Model.Name "path")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the extraFill variant of hydra.core.diff.InvalidFillError
invalidFillErrorExtraFill :: Typed.TypedTerm Int -> Typed.TypedTerm (Diff.InvalidFillError t v s)
invalidFillErrorExtraFill x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "extraFill"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the illTyped variant of hydra.core.diff.InvalidFillError
invalidFillErrorIllTyped :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.InvalidFillError t v s)
invalidFillErrorIllTyped x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "illTyped"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.core.diff.InvalidFillError
invalidFillErrorInvalidFillError :: Typed.TypedName (Diff.InvalidFillError t v s)
invalidFillErrorInvalidFillError = Typed.TypedName (Model.Name "hydra.core.diff.InvalidFillError")

-- | DSL injection for the missingFill variant of hydra.core.diff.InvalidFillError
invalidFillErrorMissingFill :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.InvalidFillError t v s)
invalidFillErrorMissingFill x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "missingFill"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the illTypedResult variant of hydra.core.diff.MigrationError
migrationErrorIllTypedResult :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm (Diff.MigrationError t v s)
migrationErrorIllTypedResult x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "illTypedResult"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.core.diff.MigrationError
migrationErrorMigrationError :: Typed.TypedName (Diff.MigrationError t v s)
migrationErrorMigrationError = Typed.TypedName (Model.Name "hydra.core.diff.MigrationError")

-- | DSL injection for the notAnInstance variant of hydra.core.diff.MigrationError
migrationErrorNotAnInstance :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)
migrationErrorNotAnInstance x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "notAnInstance"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the outOfRange variant of hydra.core.diff.MigrationError
migrationErrorOutOfRange :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)
migrationErrorOutOfRange x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "outOfRange"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the rejectedVariant variant of hydra.core.diff.MigrationError
migrationErrorRejectedVariant :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)
migrationErrorRejectedVariant x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "rejectedVariant"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the unfilledHole variant of hydra.core.diff.MigrationError
migrationErrorUnfilledHole :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.MigrationError t v s)
migrationErrorUnfilledHole x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "unfilledHole"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.core.diff.MigrationPlan
migrationPlan :: Typed.TypedTerm (M.Map n (Diff.Edit t s)) -> Typed.TypedTerm [Diff.SchemaHole n t s] -> Typed.TypedTerm (Diff.MigrationPlan n t s)
migrationPlan edits holes =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "edits"),
          Model.fieldTerm = (Typed.unTypedTerm edits)},
        Model.Field {
          Model.fieldName = (Model.Name "holes"),
          Model.fieldTerm = (Typed.unTypedTerm holes)}]}))

-- | DSL accessor for the edits field of hydra.core.diff.MigrationPlan
migrationPlanEdits :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm (M.Map n (Diff.Edit t s))
migrationPlanEdits x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
        Model.projectionFieldName = (Model.Name "edits")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the holes field of hydra.core.diff.MigrationPlan
migrationPlanHoles :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm [Diff.SchemaHole n t s]
migrationPlanHoles x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
        Model.projectionFieldName = (Model.Name "holes")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.core.diff.MigrationPlan
migrationPlanMigrationPlan :: Typed.TypedName (Diff.MigrationPlan n t s)
migrationPlanMigrationPlan = Typed.TypedName (Model.Name "hydra.core.diff.MigrationPlan")

-- | DSL updater for the edits field of hydra.core.diff.MigrationPlan
migrationPlanWithEdits :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm (M.Map n (Diff.Edit t s)) -> Typed.TypedTerm (Diff.MigrationPlan n t s)
migrationPlanWithEdits original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "edits"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "holes"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
              Model.projectionFieldName = (Model.Name "holes")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the holes field of hydra.core.diff.MigrationPlan
migrationPlanWithHoles :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm [Diff.SchemaHole n t s] -> Typed.TypedTerm (Diff.MigrationPlan n t s)
migrationPlanWithHoles original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "edits"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),
              Model.projectionFieldName = (Model.Name "edits")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "holes"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for hydra.core.diff.Migrator
migrator :: Typed.TypedTerm [Diff.Hole t s] -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v) -> Typed.TypedTerm (Diff.Migrator t v s)
migrator residualHoles apply =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "residualHoles"),
          Model.fieldTerm = (Typed.unTypedTerm residualHoles)},
        Model.Field {
          Model.fieldName = (Model.Name "apply"),
          Model.fieldTerm = (Typed.unTypedTerm apply)}]}))

-- | DSL accessor for the apply field of hydra.core.diff.Migrator
migratorApply :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v)
migratorApply x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),
        Model.projectionFieldName = (Model.Name "apply")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.core.diff.Migrator
migratorMigrator :: Typed.TypedName (Diff.Migrator t v s)
migratorMigrator = Typed.TypedName (Model.Name "hydra.core.diff.Migrator")

-- | DSL accessor for the residualHoles field of hydra.core.diff.Migrator
migratorResidualHoles :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm [Diff.Hole t s]
migratorResidualHoles x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),
        Model.projectionFieldName = (Model.Name "residualHoles")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the apply field of hydra.core.diff.Migrator
migratorWithApply :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v) -> Typed.TypedTerm (Diff.Migrator t v s)
migratorWithApply original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "residualHoles"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),
              Model.projectionFieldName = (Model.Name "residualHoles")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "apply"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the residualHoles field of hydra.core.diff.Migrator
migratorWithResidualHoles :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm [Diff.Hole t s] -> Typed.TypedTerm (Diff.Migrator t v s)
migratorWithResidualHoles original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "residualHoles"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "apply"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),
              Model.projectionFieldName = (Model.Name "apply")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for hydra.core.diff.Mistyped
mistyped :: Typed.TypedTerm v -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Mistyped t v)
mistyped value type_ =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Typed.unTypedTerm value)},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm type_)}]}))

-- | DSL name token for hydra.core.diff.Mistyped
mistypedMistyped :: Typed.TypedName (Diff.Mistyped t v)
mistypedMistyped = Typed.TypedName (Model.Name "hydra.core.diff.Mistyped")

-- | DSL accessor for the type field of hydra.core.diff.Mistyped
mistypedType :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm t
mistypedType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),
        Model.projectionFieldName = (Model.Name "type")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the value field of hydra.core.diff.Mistyped
mistypedValue :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm v
mistypedValue x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),
        Model.projectionFieldName = (Model.Name "value")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the type field of hydra.core.diff.Mistyped
mistypedWithType :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Mistyped t v)
mistypedWithType original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),
              Model.projectionFieldName = (Model.Name "value")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the value field of hydra.core.diff.Mistyped
mistypedWithValue :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.Mistyped t v)
mistypedWithValue original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "value"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for hydra.core.diff.SchemaHole
schemaHole :: Typed.TypedTerm n -> Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.SchemaHole n t s)
schemaHole typeName hole =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "typeName"),
          Model.fieldTerm = (Typed.unTypedTerm typeName)},
        Model.Field {
          Model.fieldName = (Model.Name "hole"),
          Model.fieldTerm = (Typed.unTypedTerm hole)}]}))

-- | DSL accessor for the hole field of hydra.core.diff.SchemaHole
schemaHoleHole :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm (Diff.Hole t s)
schemaHoleHole x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
        Model.projectionFieldName = (Model.Name "hole")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.core.diff.SchemaHole
schemaHoleSchemaHole :: Typed.TypedName (Diff.SchemaHole n t s)
schemaHoleSchemaHole = Typed.TypedName (Model.Name "hydra.core.diff.SchemaHole")

-- | DSL accessor for the typeName field of hydra.core.diff.SchemaHole
schemaHoleTypeName :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm n
schemaHoleTypeName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
        Model.projectionFieldName = (Model.Name "typeName")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the hole field of hydra.core.diff.SchemaHole
schemaHoleWithHole :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.SchemaHole n t s)
schemaHoleWithHole original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "typeName"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
              Model.projectionFieldName = (Model.Name "typeName")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "hole"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the typeName field of hydra.core.diff.SchemaHole
schemaHoleWithTypeName :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm n -> Typed.TypedTerm (Diff.SchemaHole n t s)
schemaHoleWithTypeName original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "typeName"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "hole"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),
              Model.projectionFieldName = (Model.Name "hole")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for hydra.core.diff.StepEdit
stepEdit :: Typed.TypedTerm s -> Typed.TypedTerm (Diff.Edit a s) -> Typed.TypedTerm (Diff.StepEdit a s)
stepEdit step edit =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "step"),
          Model.fieldTerm = (Typed.unTypedTerm step)},
        Model.Field {
          Model.fieldName = (Model.Name "edit"),
          Model.fieldTerm = (Typed.unTypedTerm edit)}]}))

-- | DSL accessor for the edit field of hydra.core.diff.StepEdit
stepEditEdit :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm (Diff.Edit a s)
stepEditEdit x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),
        Model.projectionFieldName = (Model.Name "edit")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the step field of hydra.core.diff.StepEdit
stepEditStep :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm s
stepEditStep x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),
        Model.projectionFieldName = (Model.Name "step")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.core.diff.StepEdit
stepEditStepEdit :: Typed.TypedName (Diff.StepEdit a s)
stepEditStepEdit = Typed.TypedName (Model.Name "hydra.core.diff.StepEdit")

-- | DSL updater for the edit field of hydra.core.diff.StepEdit
stepEditWithEdit :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm (Diff.Edit a s) -> Typed.TypedTerm (Diff.StepEdit a s)
stepEditWithEdit original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "step"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),
              Model.projectionFieldName = (Model.Name "step")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "edit"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the step field of hydra.core.diff.StepEdit
stepEditWithStep :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm s -> Typed.TypedTerm (Diff.StepEdit a s)
stepEditWithStep original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "step"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "edit"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),
              Model.projectionFieldName = (Model.Name "edit")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))