fay-ref- Like IORef but for Fay.

Safe HaskellNone




data FayRef a Source

A mutable variable in the Fay monad.

newFayRef :: a -> Fay (FayRef a)Source

Build a new FayRef.

readFayRef :: FayRef a -> Fay aSource

Write a new value into a FayRef.

writeFayRef :: FayRef a -> a -> Fay ()Source

Write a new value into a FayRef.

modifyFayRef :: FayRef a -> (a -> a) -> Fay ()Source

Mutate the contents of a FayRef.

Be warned that modifyFayRef does not apply the function strictly. This means if the program calls modifyFayRef many times, but seldomly uses the value, thunks will pile up in memory resulting in a space leak.

modifyFayRef' :: FayRef a -> (a -> a) -> Fay ()Source

Strict version of modifyFayRef