Contents
- Prelude
- dictate <Ch, M, A> (A value)
- confess <Ch, M, A> (Ch value)
- chronicle <Ch, M, A> (Ch @this, A that)
- chronicle <Ch, M, A> (These<Ch, A> these)
- memento <Ch, M, A> (K<ChronicleT<Ch, M>, A> ma)
- absolve <Ch, M, A> (A defaultValue, K<ChronicleT<Ch, M>, A> ma)
- condemn <Ch, M, A> (K<ChronicleT<Ch, M>, A> ma)
- censor <Ch, M, A> (Func<Ch, Ch> f, K<ChronicleT<Ch, M>, A> ma)
Methods
method ChronicleT<Ch, M, A> dictate <Ch, M, A> (A value) Source #
dictate is an action that records the output value.
Equivalent to tell for the Writable traits.
This is 'Applicative.Pure'.
Parameters
| param | value | Value to construct with |
| returns | Chronicle structure | |
method ChronicleT<Ch, M, A> confess <Ch, M, A> (Ch value) Source #
confess is an action that ends with a final output value.
Equivalent to fail for the 'Fallible' trait.
This is akin to yielding an error.
Parameters
| param | value | Value to construct with |
| returns | Chronicle structure | |
method ChronicleT<Ch, M, A> chronicle <Ch, M, A> (Ch @this, A that) Source #
Construct a new chronicle with this and that.
Parameters
| param | @this | Value to construct with |
| param | that | Value to construct with |
| returns | Chronicle structure | |
method ChronicleT<Ch, M, A> chronicle <Ch, M, A> (These<Ch, A> these) Source #
Construct a new chronicle with these.
Parameters
| param | these | What to chronicle |
| returns | Chronicle structure | |
method ChronicleT<Ch, M, Either<Ch, A>> memento <Ch, M, A> (K<ChronicleT<Ch, 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).
method ChronicleT<Ch, M, A> absolve <Ch, M, A> (A defaultValue, K<ChronicleT<Ch, 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 |
method ChronicleT<Ch, M, A> condemn <Ch, M, A> (K<ChronicleT<Ch, 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.
method ChronicleT<Ch, M, A> censor <Ch, M, A> (Func<Ch, Ch> f, K<ChronicleT<Ch, 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 |