Documentation
¶
Overview ¶
Code generated by go generate; DO NOT EDIT. This file was generated by robots at 2023-07-27 22:38:07.286388 +0200 CEST m=+0.046901101
Index ¶
- func Ap[B, R, A any](fa Reader[R, A]) func(Reader[R, func(A) B]) Reader[R, B]
- func ApplicativeMonoid[R, A any](_of func(A) func(R) A, ...) M.Monoid[func(R) A]
- func ApplySemigroup[R, A any](_map func(func(R) A, func(A) func(A) A) func(R, func(A) A), ...) S.Semigroup[func(R) A]
- func Chain[R, A, B any](f func(A) Reader[R, B]) func(Reader[R, A]) Reader[R, B]
- func Compose[R, B, C any](ab Reader[R, B]) func(Reader[B, C]) Reader[R, C]
- func Curry1[R, T1, A any](f func(R, T1) A) func(T1) Reader[R, A]
- func Curry2[R, T1, T2, A any](f func(R, T1, T2) A) func(T1) func(T2) Reader[R, A]
- func Curry3[R, T1, T2, T3, A any](f func(R, T1, T2, T3) A) func(T1) func(T2) func(T3) Reader[R, A]
- func Curry4[R, T1, T2, T3, T4, A any](f func(R, T1, T2, T3, T4) A) func(T1) func(T2) func(T3) func(T4) Reader[R, A]
- func From0[F ~func(C) R, C, R any](f F) func() Reader[C, R]
- func From1[F ~func(C, T0) R, T0, C, R any](f F) func(T0) Reader[C, R]
- func From10[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) R, ...](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) Reader[C, R]
- func From2[F ~func(C, T0, T1) R, T0, T1, C, R any](f F) func(T0, T1) Reader[C, R]
- func From3[F ~func(C, T0, T1, T2) R, T0, T1, T2, C, R any](f F) func(T0, T1, T2) Reader[C, R]
- func From4[F ~func(C, T0, T1, T2, T3) R, T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) Reader[C, R]
- func From5[F ~func(C, T0, T1, T2, T3, T4) R, T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) Reader[C, R]
- func From6[F ~func(C, T0, T1, T2, T3, T4, T5) R, T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) Reader[C, R]
- func From7[F ~func(C, T0, T1, T2, T3, T4, T5, T6) R, T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) Reader[C, R]
- func From8[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) R, ...](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) Reader[C, R]
- func From9[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) R, ...](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) Reader[C, R]
- func Local[R2, R1, A any](f func(R2) R1) func(Reader[R1, A]) Reader[R2, A]
- func Map[E, A, B any](f func(A) B) func(Reader[E, A]) Reader[E, B]
- func Promap[E, A, D, B any](f func(D) E, g func(A) B) func(Reader[E, A]) Reader[D, B]
- func Read[E, A any](e E) func(Reader[E, A]) A
- func TraverseArray[R, A, B any](f func(A) Reader[R, B]) func([]A) Reader[R, []B]
- func Uncurry0[R, A any](f Reader[R, A]) func(R) A
- func Uncurry1[R, T1, A any](f func(T1) Reader[R, A]) func(R, T1) A
- func Uncurry2[R, T1, T2, A any](f func(T1) func(T2) Reader[R, A]) func(R, T1, T2) A
- func Uncurry3[R, T1, T2, T3, A any](f func(T1) func(T2) func(T3) Reader[R, A]) func(R, T1, T2, T3) A
- func Uncurry4[R, T1, T2, T3, T4, A any](f func(T1) func(T2) func(T3) func(T4) Reader[R, A]) func(R, T1, T2, T3, T4) A
- type Reader
- func Ask[R any]() Reader[R, R]
- func Asks[R, A any](f Reader[R, A]) Reader[R, A]
- func AsksReader[R, A any](f func(R) Reader[R, A]) Reader[R, A]
- func Curry0[R, A any](f func(R) A) Reader[R, A]
- func First[A, B, C any](pab Reader[A, B]) Reader[T.Tuple2[A, C], T.Tuple2[B, C]]
- func Flatten[R, A any](mma func(R) Reader[R, A]) Reader[R, A]
- func MakeReader[R, A any](r Reader[R, A]) Reader[R, A]
- func MonadAp[B, R, A any](fab Reader[R, func(A) B], fa Reader[R, A]) Reader[R, B]
- func MonadChain[R, A, B any](ma Reader[R, A], f func(A) Reader[R, B]) Reader[R, B]
- func MonadMap[E, A, B any](fa Reader[E, A], f func(A) B) Reader[E, B]
- func Of[R, A any](a A) Reader[R, A]
- func Second[A, B, C any](pbc Reader[B, C]) Reader[T.Tuple2[A, B], T.Tuple2[A, C]]
- func SequenceArray[R, A any](ma []Reader[R, A]) Reader[R, []A]
- func SequenceT1[R, A any](a Reader[R, A]) Reader[R, T.Tuple1[A]]
- func SequenceT2[R, A, B any](a Reader[R, A], b Reader[R, B]) Reader[R, T.Tuple2[A, B]]
- func SequenceT3[R, A, B, C any](a Reader[R, A], b Reader[R, B], c Reader[R, C]) Reader[R, T.Tuple3[A, B, C]]
- func SequenceT4[R, A, B, C, D any](a Reader[R, A], b Reader[R, B], c Reader[R, C], d Reader[R, D]) Reader[R, T.Tuple4[A, B, C, D]]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicativeMonoid ¶
func ApplySemigroup ¶
func Chain ¶
Chain composes computations in sequence, using the return value of one computation to determine the next computation.
func From0 ¶
From0 converts a function with 1 parameters returning a [R] into a function with 0 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From1 ¶
From1 converts a function with 2 parameters returning a [R] into a function with 1 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From10 ¶
func From10[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) Reader[C, R]
From10 converts a function with 11 parameters returning a [R] into a function with 10 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From2 ¶
From2 converts a function with 3 parameters returning a [R] into a function with 2 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From3 ¶
From3 converts a function with 4 parameters returning a [R] into a function with 3 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From4 ¶
func From4[F ~func(C, T0, T1, T2, T3) R, T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) Reader[C, R]
From4 converts a function with 5 parameters returning a [R] into a function with 4 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From5 ¶
func From5[F ~func(C, T0, T1, T2, T3, T4) R, T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) Reader[C, R]
From5 converts a function with 6 parameters returning a [R] into a function with 5 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From6 ¶
func From6[F ~func(C, T0, T1, T2, T3, T4, T5) R, T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) Reader[C, R]
From6 converts a function with 7 parameters returning a [R] into a function with 6 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From7 ¶
func From7[F ~func(C, T0, T1, T2, T3, T4, T5, T6) R, T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) Reader[C, R]
From7 converts a function with 8 parameters returning a [R] into a function with 7 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From8 ¶
func From8[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) R, T0, T1, T2, T3, T4, T5, T6, T7, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) Reader[C, R]
From8 converts a function with 9 parameters returning a [R] into a function with 8 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func From9 ¶
func From9[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) R, T0, T1, T2, T3, T4, T5, T6, T7, T8, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) Reader[C, R]
From9 converts a function with 10 parameters returning a [R] into a function with 9 parameters returning a [Reader[C, R]] The first parameter is considered to be the context [C] of the reader
func Local ¶
Local changes the value of the local context during the execution of the action `ma` (similar to `Contravariant`'s `contramap`).
func Map ¶
Map can be used to turn functions `func(A)B` into functions `(fa F[A])F[B]` whose argument and return types use the type constructor `F` to represent some computational context.
func TraverseArray ¶
TraverseArray transforms an array
Types ¶
type Reader ¶
type Reader[R, A any] func(R) A
The purpose of the `Reader` monad is to avoid threading arguments through multiple functions in order to only get them where they are needed. The first template argument `R` is the the context to read from, the second argument `A` is the return value of the monad
func AsksReader ¶
func MakeReader ¶
MakeReader creates a reader, i.e. a method that accepts a context and that returns a value
func MonadChain ¶
func SequenceArray ¶
SequenceArray converts a homogeneous sequence of either into an either of sequence