hydra-kernel-0.18.1: src/main/haskell/Hydra/Core/Dsl/Rewriting.hs
-- Note: this is an automatically generated file. Do not edit.
-- | DSL functions for hydra.core.rewriting
module Hydra.Core.Dsl.Rewriting where
import qualified Hydra.Core.Coders as Coders
import qualified Hydra.Core.Constants as Constants
import qualified Hydra.Core.Dsl.Coders as DslCoders
import qualified Hydra.Core.Dsl.Constants as DslConstants
import qualified Hydra.Core.Dsl.Lib.Eithers as Eithers
import qualified Hydra.Core.Dsl.Lib.Lists as LibLists
import qualified Hydra.Core.Dsl.Lib.Maps as Maps
import qualified Hydra.Core.Dsl.Lib.Math as Math
import qualified Hydra.Core.Dsl.Lib.Optionals as Optionals
import qualified Hydra.Core.Dsl.Lib.Pairs as Pairs
import qualified Hydra.Core.Dsl.Lib.Sets as Sets
import qualified Hydra.Core.Dsl.Model as DslModel
import qualified Hydra.Core.Dsl.Paths as DslPaths
import qualified Hydra.Core.Dsl.Scoping as DslScoping
import qualified Hydra.Core.Graph as Graph
import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists
import qualified Hydra.Core.Model as Model
import qualified Hydra.Core.Paths as Paths
import qualified Hydra.Core.Rewriting as Rewriting
import qualified Hydra.Core.Scoping as Scoping
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
-- | DSL reference to hydra.core.rewriting.applyInsideTypeLambdasAndAnnotations
applyInsideTypeLambdasAndAnnotations :: Typed.TypedTerm (Model.Term -> Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term
applyInsideTypeLambdasAndAnnotations arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.applyInsideTypeLambdasAndAnnotations")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.foldOverTerm
foldOverTerm :: Typed.TypedTerm Coders.TraversalOrder -> Typed.TypedTerm (t0 -> Model.Term -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0
foldOverTerm arg0 arg1 arg2 arg3 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldOverTerm")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)})),
Model.applicationArgument = (Typed.unTypedTerm arg3)}))
-- | DSL reference to hydra.core.rewriting.foldOverType
foldOverType :: Typed.TypedTerm Coders.TraversalOrder -> Typed.TypedTerm (t0 -> Model.Type -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Type -> Typed.TypedTerm t0
foldOverType arg0 arg1 arg2 arg3 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldOverType")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)})),
Model.applicationArgument = (Typed.unTypedTerm arg3)}))
-- | DSL reference to hydra.core.rewriting.foldTermWithGraphAndPath
foldTermWithGraphAndPath :: Typed.TypedTerm ((t0 -> Model.Term -> t0) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> t0) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0
foldTermWithGraphAndPath arg0 arg1 arg2 arg3 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldTermWithGraphAndPath")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)})),
Model.applicationArgument = (Typed.unTypedTerm arg3)}))
-- | DSL reference to hydra.core.rewriting.mapBeneathTypeAnnotations
mapBeneathTypeAnnotations :: Typed.TypedTerm (Model.Type -> Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type
mapBeneathTypeAnnotations arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.mapBeneathTypeAnnotations")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTerm
rewriteAndFoldTerm :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)
rewriteAndFoldTerm arg0 arg1 arg2 =
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.rewriting.rewriteAndFoldTerm")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)}))
-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithGraph
rewriteAndFoldTermWithGraph :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)
rewriteAndFoldTermWithGraph arg0 arg1 arg2 arg3 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTermWithGraph")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)})),
Model.applicationArgument = (Typed.unTypedTerm arg3)}))
-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithGraphAndPath
rewriteAndFoldTermWithGraphAndPath :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)
rewriteAndFoldTermWithGraphAndPath arg0 arg1 arg2 arg3 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTermWithGraphAndPath")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)})),
Model.applicationArgument = (Typed.unTypedTerm arg3)}))
-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithPath
rewriteAndFoldTermWithPath :: Typed.TypedTerm (([Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)
rewriteAndFoldTermWithPath arg0 arg1 arg2 =
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.rewriting.rewriteAndFoldTermWithPath")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)}))
-- | DSL reference to hydra.core.rewriting.rewriteTerm
rewriteTerm :: Typed.TypedTerm ((Model.Term -> Model.Term) -> Model.Term -> Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term
rewriteTerm arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTerm")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.rewriteTermM
rewriteTermM :: Typed.TypedTerm ((Model.Term -> Either t0 Model.Term) -> Model.Term -> Either t0 Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t0 Model.Term)
rewriteTermM arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTermM")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.rewriteTermWithContext
rewriteTermWithContext :: Typed.TypedTerm ((t0 -> Model.Term -> Model.Term) -> t0 -> Model.Term -> Model.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term
rewriteTermWithContext arg0 arg1 arg2 =
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.rewriting.rewriteTermWithContext")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)}))
-- | DSL reference to hydra.core.rewriting.rewriteTermWithContextM
rewriteTermWithContextM :: Typed.TypedTerm ((t0 -> Model.Term -> Either t1 Model.Term) -> t0 -> Model.Term -> Either t1 Model.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 Model.Term)
rewriteTermWithContextM arg0 arg1 arg2 =
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.rewriting.rewriteTermWithContextM")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)}))
-- | DSL reference to hydra.core.rewriting.rewriteTermWithGraph
rewriteTermWithGraph :: Typed.TypedTerm ((Model.Term -> t0) -> Graph.Graph -> Model.Term -> t0) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0
rewriteTermWithGraph arg0 arg1 arg2 =
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.rewriting.rewriteTermWithGraph")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)})),
Model.applicationArgument = (Typed.unTypedTerm arg2)}))
-- | DSL reference to hydra.core.rewriting.rewriteType
rewriteType :: Typed.TypedTerm ((Model.Type -> Model.Type) -> Model.Type -> Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type
rewriteType arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteType")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.rewriteTypeM
rewriteTypeM :: Typed.TypedTerm ((Model.Type -> Either t0 Model.Type) -> Model.Type -> Either t0 Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either t0 Model.Type)
rewriteTypeM arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTypeM")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.subterms
subterms :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Term]
subterms arg0 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subterms")),
Model.applicationArgument = (Typed.unTypedTerm arg0)}))
-- | DSL reference to hydra.core.rewriting.subtermsWithSteps
subtermsWithSteps :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [(Paths.SubtermStep, Model.Term)]
subtermsWithSteps arg0 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtermsWithSteps")),
Model.applicationArgument = (Typed.unTypedTerm arg0)}))
-- | DSL reference to hydra.core.rewriting.subtypes
subtypes :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.Type]
subtypes arg0 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtypes")),
Model.applicationArgument = (Typed.unTypedTerm arg0)}))
-- | DSL reference to hydra.core.rewriting.subtypesWithSteps
subtypesWithSteps :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [(Paths.SubtypeStep, Model.Type)]
subtypesWithSteps arg0 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtypesWithSteps")),
Model.applicationArgument = (Typed.unTypedTerm arg0)}))
-- | DSL reference to hydra.core.rewriting.wrapTermToRecord
wrapTermToRecord :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term
wrapTermToRecord arg0 arg1 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.wrapTermToRecord")),
Model.applicationArgument = (Typed.unTypedTerm arg0)})),
Model.applicationArgument = (Typed.unTypedTerm arg1)}))
-- | DSL reference to hydra.core.rewriting.wrapTypeToRecord
wrapTypeToRecord :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type
wrapTypeToRecord arg0 =
Typed.TypedTerm (Model.TermApplication (Model.Application {
Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.wrapTypeToRecord")),
Model.applicationArgument = (Typed.unTypedTerm arg0)}))