- newRetriable<M>(monad): (<I>(initialState) => (<E, T>(strategy) => (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>))))
Returns (<I>(initialState) => (<E, T>(strategy) => (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>))))
The retriable optical.
- <I>(initialState): (<E, T>(strategy) => (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>)))
Returns (<E, T>(strategy) => (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>)))
- <E, T>(strategy): (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>))
Returns (<S, A>(triable) => (<B>(set) => Optical<M, S, T, A, B>))
- <S, A>(triable): (<B>(set) => Optical<M, S, T, A, B>)
Parameters
triable: ((data) => ((state) => Get1<M, Result<E, A>>))
Returns (<B>(set) => Optical<M, S, T, A, B>)
- <B>(set): Optical<M, S, T, A, B>
Parameters
set: ((data) => ((modified) => T))
- (data): ((modified) => T)
Returns ((modified) => T)
Returns Optical<M, S, T, A, B>
Creates a retriable optical which consists three functions:
triable
: An operation that may fail.strategy
: Failure control strategy, which decides the operation should retry or exit.set
: A function that storesB
intoS
and producesT
.