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], ...)
- type Lens
- type Lens2
- type Lens3
- type Lens4
- type Lens5
- type Lens6
- type Lens7
- type Lens8
- type Lens9
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
Types ¶
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