Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

const

memoize.const

(V 
type
, f Function V)
 => 
V
For memoization of constant values that do not depend on any input, this
uses the global constant memoization effect to keep that value

Use this as follows: Say you have an expensive function like this that
approximates pi:


You can memoize the result as follows


Then, repeated calls to `pi` will result in returning the pre-calculated value.

Effects analysis of this code will show that it uses

memoized_constant_effect pi f64

Type Parameters

0.099dev (GIT hash 9b94ad4b4a4bff2bf2be7d77be2c6e1fd7683c4d)
last changed: 2026-09-23