-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Data flow/Storing/General variables/allocate-vector.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.DataFlow.Storing.GeneralVariables.AllocateVector where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("allocate-vector",StrictFuncon stepAllocate_vector)] -- | -- /allocate-vector(T,N)/ computes a vector of length /N/ , -- containing uninitialised /variables/ of type /T/ . allocate_vector_ fargs = FApp "allocate-vector" (FTuple fargs) stepAllocate_vector fargs = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv env <- vsMatch fargs [VPAnnotated (VPMetaVar "T") (TName "values"),VPAnnotated (VPMetaVar "N") (TName "values")] env rewriteTermTo (TApp "vector-map" (TTuple [TApp "allocate-variable" (TTuple [TName "given"]),TApp "vector-repeat" (TTuple [TVar "N",TVar "T"])])) env