Documentation
¶
Index ¶
- func ForProduct2[T, A, B any](attr ...string) (Lens[T, A], Lens[T, B])
- func ForProduct3[T, A, B, C any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C])
- func ForProduct4[T, A, B, C, D any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D])
- func ForProduct5[T, A, B, C, D, E any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E])
- func ForProduct6[T, A, B, C, D, E, F any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F])
- func ForProduct7[T, A, B, C, D, E, F, G any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], ...)
- func ForProduct8[T, A, B, C, D, E, F, G, H any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], ...)
- func ForProduct9[T, A, B, C, D, E, F, G, H, I any](attr ...string) (Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], ...)
- func ForSpectrum2[T, A, B any](attr ...string) (Reflector[A], Reflector[B])
- func ForSpectrum3[T, A, B, C any](attr ...string) (Reflector[A], Reflector[B], Reflector[C])
- func ForSpectrum4[T, A, B, C, D any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D])
- func ForSpectrum5[T, A, B, C, D, E any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E])
- func ForSpectrum6[T, A, B, C, D, E, F any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], ...)
- func ForSpectrum7[T, A, B, C, D, E, F, G any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], ...)
- func ForSpectrum8[T, A, B, C, D, E, F, G, H any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], ...)
- func ForSpectrum9[T, A, B, C, D, E, F, G, H, I any](attr ...string) (Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], ...)
- type Isomorphism
- type Lens
- type Lens2
- type Lens3
- type Lens4
- type Lens5
- type Lens6
- type Lens7
- type Lens8
- type Lens9
- type Reflector
- type Shape
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForProduct2 ¶
ForProduct2 unfold 2 attribute of type T
func ForProduct3 ¶
ForProduct3 unfold 3 attribute of type T
func ForProduct4 ¶
func ForProduct4[T, A, B, C, D any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], )
ForProduct4 unfold 4 attribute of type T
func ForProduct5 ¶
func ForProduct5[T, A, B, C, D, E any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], )
ForProduct5 unfold 5 attribute of type T
func ForProduct6 ¶
func ForProduct6[T, A, B, C, D, E, F any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], )
ForProduct6 unfold 6 attribute of type T
func ForProduct7 ¶
func ForProduct7[T, A, B, C, D, E, F, G any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], Lens[T, G], )
ForProduct7 unfold 7 attribute of type T
func ForProduct8 ¶
func ForProduct8[T, A, B, C, D, E, F, G, H any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], Lens[T, G], Lens[T, H], )
ForProduct8 unfold 8 attribute of type T
func ForProduct9 ¶
func ForProduct9[T, A, B, C, D, E, F, G, H, I any](attr ...string) ( Lens[T, A], Lens[T, B], Lens[T, C], Lens[T, D], Lens[T, E], Lens[T, F], Lens[T, G], Lens[T, H], Lens[T, I], )
ForProduct9 unfold 9 attribute of type T
func ForSpectrum2 ¶ added in v0.11.2
ForSpectrum2 unfold 2 attribute of type T
func ForSpectrum3 ¶ added in v0.11.2
ForSpectrum3 unfold 3 attribute of type T
func ForSpectrum4 ¶ added in v0.11.2
func ForSpectrum4[T, A, B, C, D any](attr ...string) ( Reflector[A], Reflector[B], Reflector[C], Reflector[D], )
ForSpectrum4 unfold 4 attribute of type T
func ForSpectrum5 ¶ added in v0.11.2
func ForSpectrum5[T, A, B, C, D, E any](attr ...string) ( Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], )
ForSpectrum5 unfold 5 attribute of type T
func ForSpectrum6 ¶ added in v0.11.2
func ForSpectrum6[T, A, B, C, D, E, F any](attr ...string) ( Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], Reflector[F], )
ForSpectrum6 unfold 6 attribute of type T
func ForSpectrum7 ¶ added in v0.11.2
func ForSpectrum7[T, A, B, C, D, E, F, G any](attr ...string) ( Reflector[A], Reflector[B], Reflector[C], Reflector[D], Reflector[E], Reflector[F], Reflector[G], )
ForSpectrum7 unfold 7 attribute of type T
Types ¶
type Isomorphism ¶ added in v0.12.0
type Isomorphism[A, B any] interface { FromAtoB(*A, *B) FromBtoA(*B, *A) }
An isomorphism is a structure-preserving mapping between two structures of the same shape that can be reversed by an inverse mapping.
type Lens ¶
type Lens[S, A any] interface { Get(*S) A Put(*S, A) *S }
Lens resembles concept of getters and setters, which you can compose using functional concepts. In other words, this is combinator data transformation for pure functional data structure.
Lens allows to abstract a "shape" of the structure rather than type itself.
func ForProduct1 ¶
ForProduct1 unfold 1 attribute of type T
type Lens2 ¶ added in v0.11.0
type Lens2[S, A, B any] interface { Get(*S) (A, B) Put(*S, A, B) *S }
Rank 2 Shape: Product Lens A × B
type Lens3 ¶ added in v0.11.0
type Lens3[S, A, B, C any] interface { Get(*S) (A, B, C) Put(*S, A, B, C) *S }
Rank 3 Shape: Product Lens A × B × C
type Lens4 ¶ added in v0.11.0
type Lens4[S, A, B, C, D any] interface { Get(*S) (A, B, C, D) Put(*S, A, B, C, D) *S }
Rank 4 Shape: Product Lens A × B × C × D
type Lens5 ¶ added in v0.11.0
type Lens5[S, A, B, C, D, E any] interface { Get(*S) (A, B, C, D, E) Put(*S, A, B, C, D, E) *S }
Rank 5 Shape: Product Lens A × B × C × D × E
type Lens6 ¶ added in v0.11.0
type Lens6[S, A, B, C, D, E, F any] interface { Get(*S) (A, B, C, D, E, F) Put(*S, A, B, C, D, E, F) *S }
Rank 6 Shape: Product Lens A × B × C × D × E × F
type Lens7 ¶ added in v0.11.0
type Lens7[S, A, B, C, D, E, F, G any] interface { Get(*S) (A, B, C, D, E, F, G) Put(*S, A, B, C, D, E, F, G) *S }
Rank 7 Shape: Product Lens A × B × C × D × E × F × G
type Lens8 ¶ added in v0.11.0
type Lens8[S, A, B, C, D, E, F, G, H any] interface { Get(*S) (A, B, C, D, E, F, G, H) Put(*S, A, B, C, D, E, F, G, H) *S }
Rank 8 Shape: Product Lens A × B × C × D × E × F × G × H
type Lens9 ¶ added in v0.11.0
type Lens9[S, A, B, C, D, E, F, G, H, I any] interface { Get(*S) (A, B, C, D, E, F, G, H, I) Put(*S, A, B, C, D, E, F, G, H, I) *S }
Rank 9 Shape: Product Lens A × B × C × D × E × F × G × H × I
type Reflector ¶
Reflector is a Reflector over value of any type. It fails runtime if client submits invalid type.
func ForSpectrum1 ¶ added in v0.11.2
ForSpectrum1 unfold 1 attribute of type T