data-diverse-lens-4.1.0.0: Isos & Lens for Data.Diverse.Many and Prisms for Data.Diverse.Which

Safe HaskellNone
LanguageHaskell2010

Data.Diverse.Lens.Many

Contents

Synopsis

Isomorphism

_Many :: IsMany t xs a => Iso' (Many xs) (t xs a) Source #

_Many = iso fromMany toMany

_Many' :: IsMany Tagged xs a => Iso' (Many xs) a Source #

_Many' = iso fromMany' toMany'

Single field

Lens for a single field

class Has a t where #

A type class for extensible product.

We provide instances for tuples up to 12 elements by default. You can define your own instance of Has, but most of the time tuples will do fine.

Minimal complete definition

getter, modifier | hasLens

Methods

getter :: t -> a #

modifier :: (a -> a) -> t -> t #

hasLens :: Lens t a #

Instances

Has a a 

Methods

getter :: a -> a #

modifier :: (a -> a) -> a -> a #

hasLens :: Lens a a #

Has b (a, b) 

Methods

getter :: (a, b) -> b #

modifier :: (b -> b) -> (a, b) -> (a, b) #

hasLens :: Lens (a, b) b #

Has a (a, b) 

Methods

getter :: (a, b) -> a #

modifier :: (a -> a) -> (a, b) -> (a, b) #

hasLens :: Lens (a, b) a #

Has c (a, b, c) 

Methods

getter :: (a, b, c) -> c #

modifier :: (c -> c) -> (a, b, c) -> (a, b, c) #

hasLens :: Lens (a, b, c) c #

Has b (a, b, c) 

Methods

getter :: (a, b, c) -> b #

modifier :: (b -> b) -> (a, b, c) -> (a, b, c) #

hasLens :: Lens (a, b, c) b #

Has a (a, b, c) 

Methods

getter :: (a, b, c) -> a #

modifier :: (a -> a) -> (a, b, c) -> (a, b, c) #

hasLens :: Lens (a, b, c) a #

Has d (a, b, c, d) 

Methods

getter :: (a, b, c, d) -> d #

modifier :: (d -> d) -> (a, b, c, d) -> (a, b, c, d) #

hasLens :: Lens (a, b, c, d) d #

Has c (a, b, c, d) 

Methods

getter :: (a, b, c, d) -> c #

modifier :: (c -> c) -> (a, b, c, d) -> (a, b, c, d) #

hasLens :: Lens (a, b, c, d) c #

Has b (a, b, c, d) 

Methods

getter :: (a, b, c, d) -> b #

modifier :: (b -> b) -> (a, b, c, d) -> (a, b, c, d) #

hasLens :: Lens (a, b, c, d) b #

Has a (a, b, c, d) 

Methods

getter :: (a, b, c, d) -> a #

modifier :: (a -> a) -> (a, b, c, d) -> (a, b, c, d) #

hasLens :: Lens (a, b, c, d) a #

Has e (a, b, c, d, e) 

Methods

getter :: (a, b, c, d, e) -> e #

modifier :: (e -> e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

hasLens :: Lens (a, b, c, d, e) e #

Has d (a, b, c, d, e) 

Methods

getter :: (a, b, c, d, e) -> d #

modifier :: (d -> d) -> (a, b, c, d, e) -> (a, b, c, d, e) #

hasLens :: Lens (a, b, c, d, e) d #

Has c (a, b, c, d, e) 

Methods

getter :: (a, b, c, d, e) -> c #

modifier :: (c -> c) -> (a, b, c, d, e) -> (a, b, c, d, e) #

hasLens :: Lens (a, b, c, d, e) c #

Has b (a, b, c, d, e) 

Methods

getter :: (a, b, c, d, e) -> b #

modifier :: (b -> b) -> (a, b, c, d, e) -> (a, b, c, d, e) #

hasLens :: Lens (a, b, c, d, e) b #

Has a (a, b, c, d, e) 

Methods

getter :: (a, b, c, d, e) -> a #

modifier :: (a -> a) -> (a, b, c, d, e) -> (a, b, c, d, e) #

hasLens :: Lens (a, b, c, d, e) a #

Has f (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) f #

Has e (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) e #

Has d (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) d #

Has c (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) c #

Has b (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) b #

Has a (a, b, c, d, e, f) 

Methods

getter :: (a, b, c, d, e, f) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

hasLens :: Lens (a, b, c, d, e, f) a #

Has g (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) g #

Has f (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) f #

Has e (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) e #

Has d (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) d #

Has c (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) c #

Has b (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) b #

Has a (a, b, c, d, e, f, g) 

Methods

getter :: (a, b, c, d, e, f, g) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

hasLens :: Lens (a, b, c, d, e, f, g) a #

Has h (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> h #

modifier :: (h -> h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) h #

Has g (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) g #

Has f (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) f #

Has e (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) e #

Has d (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) d #

Has c (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) c #

Has b (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) b #

Has a (a, b, c, d, e, f, g, h) 

Methods

getter :: (a, b, c, d, e, f, g, h) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

hasLens :: Lens (a, b, c, d, e, f, g, h) a #

Has i (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> i #

modifier :: (i -> i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) i #

Has h (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> h #

modifier :: (h -> h) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) h #

Has g (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) g #

Has f (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) f #

Has e (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) e #

Has d (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) d #

Has c (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) c #

Has b (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) b #

Has a (a, b, c, d, e, f, g, h, i) 

Methods

getter :: (a, b, c, d, e, f, g, h, i) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i) a #

Has j (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> j #

modifier :: (j -> j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) j #

Has i (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> i #

modifier :: (i -> i) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) i #

Has h (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> h #

modifier :: (h -> h) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) h #

Has g (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) g #

Has f (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) f #

Has e (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) e #

Has d (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) d #

Has c (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) c #

Has b (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) b #

Has a (a, b, c, d, e, f, g, h, i, j) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j) a #

Has k (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> k #

modifier :: (k -> k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) k #

Has j (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> j #

modifier :: (j -> j) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) j #

Has i (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> i #

modifier :: (i -> i) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) i #

Has h (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> h #

modifier :: (h -> h) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) h #

Has g (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) g #

Has f (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) f #

Has e (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) e #

Has d (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) d #

Has c (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) c #

Has b (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) b #

Has a (a, b, c, d, e, f, g, h, i, j, k) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k) a #

Has l (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> l #

modifier :: (l -> l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) l #

Has k (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> k #

modifier :: (k -> k) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) k #

Has j (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> j #

modifier :: (j -> j) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) j #

Has i (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> i #

modifier :: (i -> i) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) i #

Has h (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> h #

modifier :: (h -> h) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) h #

Has g (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> g #

modifier :: (g -> g) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) g #

Has f (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> f #

modifier :: (f -> f) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) f #

Has e (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> e #

modifier :: (e -> e) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) e #

Has d (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> d #

modifier :: (d -> d) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) d #

Has c (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> c #

modifier :: (c -> c) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) c #

Has b (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> b #

modifier :: (b -> b) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) b #

Has a (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

getter :: (a, b, c, d, e, f, g, h, i, j, k, l) -> a #

modifier :: (a -> a) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

hasLens :: Lens (a, b, c, d, e, f, g, h, i, j, k, l) a #

piece' :: Has a s => Lens' s a Source #

Convient name for hasLens to be consistent with Had typeclass.

let x = (5 :: Int) ./ False ./ 'X' ./ Just 'O' ./ nil
x ^. piece' @Int `shouldBe` 5
(x & piece' @Int .~ 6) `shouldBe` (6 :: Int) ./ False ./ 'X' ./ Just 'O' ./ nil

pieceTag :: forall l a b s. Had (Tagged l a) s => Lens s (Replaced (Tagged l a) (Tagged l b) s) a b Source #

pieceTag' :: forall l a s. Has (Tagged l a) s => Lens' s a Source #

class (Has a s, Replaced a a s ~ s) => Had a s where Source #

Polymorphic version of piece'

Minimal complete definition

piece

Associated Types

type Replaced a b s Source #

Methods

piece :: Lens s (Replaced a b s) a b Source #

Instances

UniqueMember * x xs => Had x (Many xs) Source # 

Associated Types

type Replaced x b (Many xs) :: * Source #

Methods

piece :: Functor f => (x -> f b) -> Many xs -> f (Replaced x b (Many xs)) Source #

class HasL (l :: k) a s | s l -> a where Source #

grabL (view pieceL) and replaceL (set pieceL) in Lens' form.

let x = (5 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ nil
x ^. pieceL' @Foo `shouldBe` Tagged @Foo False
(x & pieceL' @Foo .~ Tagged @Foo True) `shouldBe` (5 :: Int) ./ Tagged @Foo True ./ Tagged @Bar 'X' ./ nil

A default implementation using generics is not provided as it make GHC think that l must be type Symbol when l can actually be any kind. Create instances of HasL using Data.Generics.Product.Fields as follows: instance HasField' l Foo a => pieceL' l a Foo where pieceL' = field l default pieceL' :: forall (l :: Symbol) a s. (HasField' l s a) => Lens' s a pieceL' = field @l

Minimal complete definition

pieceL'

Methods

pieceL' :: Lens' s a Source #

Instances

(UniqueLabelMember k * l xs, (~) * x (KindAtLabel k * l xs)) => HasL k l x (Many xs) Source # 

Methods

pieceL' :: Lens' s (Many xs) Source #

class (HasL (l :: k) a s, ReplacedL l a a s ~ s) => HadL (l :: k) a s | s l -> a where Source #

Polymorphic version of pieceL'

let x = (5 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ nil
(x & pieceL @Foo .~ "foo") `shouldBe` (5 :: Int) ./ "foo" ./ Tagged @Bar 'X' ./ nil

Minimal complete definition

pieceL

Associated Types

type ReplacedL l a b s Source #

Methods

pieceL :: Lens s (ReplacedL l a b s) a b Source #

Instances

(UniqueLabelMember k * l xs, (~) * x (KindAtLabel k * l xs)) => HadL k l x (Many xs) Source # 

Associated Types

type ReplacedL l (x :: l) (Many xs) b s :: * Source #

Methods

pieceL :: Functor f => (Many xs -> f b) -> s -> f (ReplacedL l x (Many xs) b s) Source #

class HasN (n :: Nat) a s | s n -> a where Source #

grabN (view piece) and replaceN' (set piece') in Lens' form.

let x = (5 :: Int) ./ False ./ 'X' ./ Just 'O' ./ (6 :: Int) ./ Just 'A' ./ nil
x ^. pieceN' @0 `shouldBe` 5
(x & pieceN' @0 .~ 6) `shouldBe` (6 :: Int) ./ False ./ 'X' ./ Just 'O' ./ (6 :: Int) ./ Just 'A' ./ nil

Minimal complete definition

pieceN'

Methods

pieceN' :: Lens' s a Source #

Instances

MemberAt * n x xs => HasN n x (Many xs) Source # 

Methods

pieceN' :: Lens' (Many xs) x Source #

class (HasN (n :: Nat) a s, ReplacedN n a a s ~ s) => HadN (n :: Nat) a s | s n -> a where Source #

Polymorphic version of pieceN'

Minimal complete definition

pieceN

Associated Types

type ReplacedN n a b s Source #

Methods

pieceN :: Lens s (ReplacedN n a b s) a b Source #

Instances

MemberAt * n x xs => HadN n x (Many xs) Source # 

Associated Types

type ReplacedN (n :: Nat) x b (Many xs) :: * Source #

Methods

pieceN :: Functor f => (x -> f b) -> Many xs -> f (ReplacedN n x b (Many xs)) Source #

Multiple fields

Lens for multiple fields

type Project (smaller :: [Type]) (smaller' :: [Type]) (larger :: [Type]) (larger' :: [Type]) = (Select smaller larger, Amend smaller smaller' larger, larger' ~ Replaces smaller smaller' larger) Source #

A friendlier constraint synonym for project.

project :: forall smaller smaller' larger larger'. Project smaller smaller' larger larger' => Lens (Many larger) (Many larger') (Many smaller) (Many smaller') Source #

Polymorphic version of project'

type Project' (smaller :: [Type]) (larger :: [Type]) = (Select smaller larger, Amend' smaller larger) Source #

A friendlier constraint synonym for project'.

project' :: forall smaller larger. Project' smaller larger => Lens' (Many larger) (Many smaller) Source #

select (view project) and amend (set project) in Lens' form.

project = lens select amend
let x = (5 :: Int) ./ False ./ 'X' ./ Just 'O' ./ nil
x ^. (project' @_ @'[Int, Maybe Char]) `shouldBe` (5 :: Int) ./ Just 'O' ./ nil
(x & (project' @_ @'[Int, Maybe Char]) .~ ((6 :: Int) ./ Just P ./ nil)) `shouldBe`
    (6 :: Int) ./ False ./ 'X' ./ Just 'P' ./ nil

type ProjectL (ls :: [k]) (smaller :: [Type]) (smaller' :: [Type]) (larger :: [Type]) (larger' :: [Type]) = (Select smaller larger, Amend smaller smaller' larger, smaller ~ KindsAtLabels ls larger, IsDistinct ls, UniqueLabels ls larger, larger' ~ Replaces smaller smaller' larger) Source #

A friendlier constraint synonym for projectL.

projectL :: forall ls smaller smaller' larger larger'. ProjectL ls smaller smaller' larger larger' => Lens (Many larger) (Many larger') (Many smaller) (Many smaller') Source #

Polymorphic version of projectL'

let x = False ./ Tagged @"Hi" (5 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ Tagged @"Bye" 'O' ./ nil
(x & (projectL @'["Hi", "Bye"] .~ (True ./ Tagged @"Changed" False ./ nil)) `shouldBe`
    False ./ True ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ Tagged @"Changed" False ./ nil

type ProjectL' (ls :: [k]) (smaller :: [Type]) (larger :: [Type]) = (Select smaller larger, Amend' smaller larger, smaller ~ KindsAtLabels ls larger, IsDistinct ls, UniqueLabels ls larger) Source #

A friendlier constraint synonym for projectL'.

projectL' :: forall ls smaller larger. ProjectL' ls smaller larger => Lens' (Many larger) (Many smaller) Source #

selectL (view projectL) and amendL (set projectL) in Lens' form.

let x = False ./ Tagged @"Hi" (5 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ Tagged @"Bye" 'O' ./ nil
x ^. (projectL' @'[Foo, Bar] `shouldBe` Tagged @Foo False ./ Tagged @Bar 'X' ./ nil
(x & (projectL' @'["Hi", "Bye"] .~ (Tagged @"Hi" (6 :: Int) ./ Tagged @"Bye" 'P' ./ nil)) 'shouldBe
    False ./ Tagged @"Hi" (6 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ Tagged @"Bye" 'P' ./ nil

type ProjectN (ns :: [Nat]) (smaller :: [Type]) (smaller' :: [Type]) (larger :: [Type]) (larger' :: [Type]) = (SelectN ns smaller larger, AmendN ns smaller smaller' larger, larger' ~ ReplacesIndex ns smaller' larger) Source #

A friendlier constraint synonym for projectN.

projectN :: forall ns smaller smaller' larger larger'. ProjectN ns smaller smaller' larger larger' => Lens (Many larger) (Many larger') (Many smaller) (Many smaller') Source #

Polymorphic version of projectN'

type ProjectN' (ns :: [Nat]) (smaller :: [Type]) (larger :: [Type]) = (SelectN ns smaller larger, AmendN' ns smaller larger) Source #

A friendlier constraint synonym for projectN'.

projectN' :: forall ns smaller larger. ProjectN' ns smaller larger => Lens' (Many larger) (Many smaller) Source #

selectN (view projectN) and amendN (set projectN) in Lens' form.

projectN = lens selectN amendN
let x = (5 :: Int) ./ False ./ 'X' ./ Just 'O' ./ (6 :: Int) ./ Just 'A' ./ nil
x ^. projectN @_ @'[5, 4, 0] `shouldBe` Just 'A' ./ (6 :: Int) ./ (5 ::Int) ./ nil
(x & projectN @_ @'[5, 4, 0] .~ (Just 'B' ./ (8 :: Int) ./ (4 ::Int) ./ nil)) `shouldBe`
    (4 :: Int) ./ False ./ 'X' ./ Just 'O' ./ (8 :: Int) ./ Just 'B' ./ nil

Orphan instances

UniqueMember * x xs => Has x (Many xs) Source # 

Methods

getter :: Many xs -> x #

modifier :: (x -> x) -> Many xs -> Many xs #

hasLens :: Lens (Many xs) x #