-- GeNeRaTeD fOr: ../../CBS/Funcons/Abstractions/Functions/supply.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Abstractions.Functions.Supply where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("supply",StrictFuncon stepSupply)] -- | -- /supply(V,F)/ supplies /V/ as the argument to the function /F/ , without -- executing the function. The result is a thunk that does not depend on -- an argument when forced. supply_ fargs = FApp "supply" (FTuple fargs) stepSupply fargs = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv env <- vsMatch fargs [VPAnnotated (VPMetaVar "V") (TName "values"),VPAnnotated (VPMetaVar "F") (TName "values")] env rewriteTermTo (TApp "thunk" (TTuple [TApp "apply" (TTuple [TVar "F",TVar "V"])])) env