-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Data flow/Giving/given.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.DataFlow.Giving.Given where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("given",NullaryFuncon stepGiven),("given1",NullaryFuncon stepGiven1),("given2",NullaryFuncon stepGiven2),("given3",NullaryFuncon stepGiven3)] -- | -- /given/ returns the current given value. given_ = FName "given" stepGiven = evalRules [] [step1] where step1 = do let env = emptyEnv env <- getInhPatt "given-value" (VPMetaVar "V") env stepTermTo (TVar "V") env -- | -- /given1/ returns the first component of the currently given tuple. -- /given2/ returns the second component of the currently given tuple. -- /given3/ returns the third component of the currently given tuple. given1_ = FName "given1" stepGiven1 = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv rewriteTo (FApp "tuple-index" (FTuple [FName "given",FValue (Nat 1)])) given2_ = FName "given2" stepGiven2 = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv rewriteTo (FApp "tuple-index" (FTuple [FName "given",FValue (Nat 2)])) given3_ = FName "given3" stepGiven3 = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv rewriteTo (FApp "tuple-index" (FTuple [FName "given",FValue (Nat 3)]))