Contents
- ChronicalerExtensions
- Memento <Ch, M, A> (this K<M, A> ma)
- Absolve <Ch, M, A> (this K<M, A> ma, A defaultValue)
- Condemn <Ch, M, A> (this K<M, A> ma)
- Censor <Ch, M, A> (this K<M, A> ma, Func<Ch, Ch> f)
- Chronicle <Ch, M, A> (this These<Ch, A> ma)
- Chronicaler <Ch>
- dictate <M, A> (A value)
- confess <M, A> (Ch confession)
- memento <M, A> (K<M, A> ma)
- absolve <M, A> (A defaultValue, K<M, A> ma)
- condemn <M, A> (K<M, A> ma)
- censor <M, A> (Func<Ch, Ch> f, K<M, A> ma)
- chronicle <M, A> (These<Ch, A> ma)
- Chronicaler <M, Ch>
class ChronicalerExtensions Source #
Methods
method K<M, Either<Ch, A>> Memento <Ch, M, A> (this K<M, A> ma) Source #
Memento is an action that executes the action within this structure, returning either
its record, if it ended with Confess, or its final value otherwise, with any record
added to the current record.
Similar to 'Catch' in the 'Fallible' trait, but with a notion of non-fatal errors (which are accumulated) vs. fatal errors (which are caught without accumulating).
Parameters
| param | ma | Action to memento |
method K<M, A> Absolve <Ch, M, A> (this K<M, A> ma, A defaultValue) Source #
Absolve is an action that executes this structure and discards any record it had.
The defaultValue will be used if the action ended via Confess.
Parameters
| param | defaultValue | |
| param | ma | Action to absolve |
method K<M, A> Condemn <Ch, M, A> (this K<M, A> ma) Source #
Condemn is an action that executes the structure and keeps its value
only if it had no record. Otherwise, the value (if any) will be discarded
and only the record kept.
This can be seen as converting non-fatal errors into fatal ones.
Parameters
| param | ma | Action to condemn |
method K<M, A> Censor <Ch, M, A> (this K<M, A> ma, Func<Ch, Ch> f) Source #
An action that executes the structure and applies the function f to its output, leaving
the return value unchanged.-
Equivalent to censor for the 'Writable` trait.
Parameters
| param | f | Censoring function |
| param | ma | Action to censor |
class Chronicaler <Ch> Source #
Methods
method K<M, A> dictate <M, A> (A value) Source #
Dictate is an action that records the output value.
Equivalent to tell for the Writable traits.
Parameters
| param | value | Value to construct with |
| returns | Chronicle structure | |
method K<M, A> confess <M, A> (Ch confession) Source #
Confess is an action that ends with a final output value.
Equivalent to fail for the 'Fallible' trait.
Parameters
| param | confession | Value to construct with |
| returns | Chronicle structure | |
method K<M, Either<Ch, A>> memento <M, A> (K<M, A> ma) Source #
Memento is an action that executes the action within this structure, returning either
its record, if it ended with Confess, or its final value otherwise, with any record
added to the current record.
Similar to 'Catch' in the 'Fallible' trait, but with a notion of non-fatal errors (which are accumulated) vs. fatal errors (which are caught without accumulating).
Parameters
| param | ma | Action to memento |
method K<M, A> absolve <M, A> (A defaultValue, K<M, A> ma) Source #
Absolve is an action that executes this structure and discards any record it had.
The defaultValue will be used if the action ended via Confess.
Parameters
| param | defaultValue | |
| param | ma | Action to absolve |
method K<M, A> condemn <M, A> (K<M, A> ma) Source #
Condemn is an action that executes the structure and keeps its value
only if it had no record. Otherwise, the value (if any) will be discarded
and only the record kept.
This can be seen as converting non-fatal errors into fatal ones.
Parameters
| param | ma | Action to condemn |
method K<M, A> censor <M, A> (Func<Ch, Ch> f, K<M, A> ma) Source #
An action that executes the structure and applies the function f to its output, leaving
the return value unchanged.-
Equivalent to censor for the 'Writable` trait.
Parameters
| param | f | Censoring function |
| param | ma | Action to censor |
interface Chronicaler <M, Ch> Source #
Hybrid error/writer monad class that allows both accumulating outputs and aborting computation with a final output.
The expected use case is for computations with a notion of fatal vs. non-fatal errors.
Parameters
| type | M | Self |
| type | Ch | Chronicle type |
Methods
method K<M, A> Dictate <A> (A value) Source #
Dictate is an action that records the output value.
Equivalent to tell for the Writable traits.
Parameters
| param | value | Value to construct with |
| returns | Chronicle structure | |
method K<M, A> Confess <A> (Ch confession) Source #
Confess is an action that ends with a final output value.
Equivalent to fail for the 'Fallible' trait.
Parameters
| param | confession | Value to construct with |
| returns | Chronicle structure | |
method K<M, Either<Ch, A>> Memento <A> (K<M, A> ma) Source #
Memento is an action that executes the action within this structure, returning either
its record, if it ended with Confess, or its final value otherwise, with any record
added to the current record.
Similar to 'Catch' in the 'Fallible' trait, but with a notion of non-fatal errors (which are accumulated) vs. fatal errors (which are caught without accumulating).
Parameters
| param | ma | Action to memento |
method K<M, A> Absolve <A> (A defaultValue, K<M, A> ma) Source #
Absolve is an action that executes this structure and discards any record it had.
The defaultValue will be used if the action ended via Confess.
Parameters
| param | defaultValue | |
| param | ma | Action to absolve |
method K<M, A> Condemn <A> (K<M, A> ma) Source #
Condemn is an action that executes the structure and keeps its value
only if it had no record. Otherwise, the value (if any) will be discarded
and only the record kept.
This can be seen as converting non-fatal errors into fatal ones.
Parameters
| param | ma | Action to condemn |