data Ref : Type -> Type -> Type A linear mutable reference
Totality: total
Visibility: export
Constructor: R1 : Mut a -> Ref s a
0 IORef : Type -> Type Alias for `Ref RIO`
Totality: total
Visibility: public exportref1 : a -> F1 s (Ref s a) Creates a new mutable reference tagged with `tag` and holding
initial value `v`.
Totality: total
Visibility: exportnewref : Lift1 s f => a -> f (Ref s a)
Totality: total
Visibility: export =DEPRECATED=newIORef : HasIO io => a -> io (IORef a) Creates a mutable reference in `IO` land.
Deprecated: Use `newref` instead
Totality: total
Visibility: exportread1 : Ref s a -> F1 s a Reads the current value at a mutable reference tagged with `tag`.
Totality: total
Visibility: exportreadref : Lift1 s f => Ref s a -> f a Convenience alias for `runIO $ read1 r` for reading a reference in
`IO`.
Totality: total
Visibility: exportwrite1 : Ref s a -> a -> F1' s Updates the mutable reference tagged with `tag`.
Totality: total
Visibility: exportwriteref : Lift1 s f => Ref s a -> a -> f () Convenience alias for `runIO $ write1 r v` for writing to a reference in
`IO`.
Totality: total
Visibility: exportcaswrite1 : Ref s a -> a -> a -> F1 s Bool Atomically writes `val` to the mutable reference if its current
value is equal to `pre`.
This is supported and has been tested on the Chez and Racket backends.
It trivially works on the JavaScript backends, which are single-threaded
anyway.
Totality: total
Visibility: exportcasswap1 : Ref s a -> a -> F1' s Atomic overwrite of a mutable reference using a CAS-loop
internally
This is supported and has been tested on the Chez and Racket backends.
It trivially works on the JavaScript backends, which are single-threaded
anyway.
Totality: total
Visibility: exportcasupdate1 : Ref s a -> (a -> (a, b)) -> F1 s b Atomic modification of a mutable reference using a CAS-loop
internally
This is supported and has been tested on the Chez and Racket backends.
It trivially works on the JavaScript backends, which are single-threaded
anyway.
Totality: total
Visibility: exportupdate : Lift1 s f => Ref s a -> (a -> (a, b)) -> f b Atomically updates and reads a mutable reference in `IO`.
This uses `casupdate1` internally.
Totality: total
Visibility: exportcasmod1 : Ref s a -> (a -> a) -> F1' s Atomic modification of a mutable reference using a CAS-loop
internally
This is supported and has been tested on the Chez and Racket backends.
It trivially works on the JavaScript backends, which are single-threaded
anyway.
Totality: total
Visibility: exportmod1 : Ref s a -> (a -> a) -> F1' s Modifies the value stored in mutable reference tagged with `tag`.
Totality: total
Visibility: exportmod : Lift1 s f => Ref s a -> (a -> a) -> f () Atomically modifies a mutable reference in `IO`.
This uses `casmod1` internally.
Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 9modAndRead1 : Ref s a -> (a -> a) -> F1 s a Modifies the value stored in mutable reference tagged with `tag`
and returns the updated value.
Totality: total
Visibility: exportreadAndMod1 : Ref s a -> (a -> a) -> F1 s a Modifies the value stored in mutable reference tagged with `tag`
and returns the previous value.
Totality: total
Visibility: exportwhenRef1 : Ref s Bool -> Lazy (F1' s) -> F1' s Runs the given stateful computation only when given boolean flag
is currently at `True`
Totality: total
Visibility: export0 WithRef1 : Type -> Type -> Type Alias for a function taking a linear mutable refernce as
an auto-implicit argument.
Totality: total
Visibility: public exportwithRef1 : a -> WithRef1 a b -> b Runs a function requiring a linear mutable reference.
Totality: total
Visibility: exportrecord Lzy : Type -> Type A delayed computation with memoization:
The delayed computation will be run only once. After that, the result
will be stored in and retrieved from a mutable reference.
Totality: total
Visibility: public export
Constructor: L : Mut (ST a) -> Lzy a
Projection: .mut : Lzy a -> Mut (ST a)
Hints:
Applicative Lzy Functor Lzy Monad Lzy
.mut : Lzy a -> Mut (ST a)- Totality: total
Visibility: public export mut : Lzy a -> Mut (ST a)- Totality: total
Visibility: public export lazy : Lazy a -> Lzy a Wraps a delayed computation into a value of type `Lzy`.
Totality: total
Visibility: exportval : Lzy a -> a Forces a delayed computation, extracting its value.
Totality: total
Visibility: exportfix : (Lzy a -> a) -> a This is unsafe and non-total and highly experimental.
I'll try to eventually implement a safe version of this.
Totality: total
Visibility: export