cache_invariant: Make a function cache invariant

View source: R/aaa.R

cache_invariantR Documentation

Make a function cache invariant

Description

This first time a function from this is called it will run the function itself and save the output in memory. On subsequent calls the in memory cached version will be returned. This cache is separate by language.

Usage

cache_invariant(name, fn)

Arguments

name

The name of the function in the cache

fn

The function itself

Value

Cache invariant version of fn


mrc-ide/naomi documentation built on April 10, 2024, 2:13 p.m.