data-diverse-lens-4.3.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 
Instance details

Defined in Data.Has

Methods

getter :: a -> a #

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

hasLens :: Lens a a #

UniqueMember x xs => Has x (Many xs) # 
Instance details

Defined in Data.Diverse.Lens.Many

Methods

getter :: Many xs -> x #

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

hasLens :: Lens (Many xs) x #

Has b (a, b) 
Instance details

Defined in Data.Has

Methods

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

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

hasLens :: Lens (a, b) b #

Has a (a, b) 
Instance details

Defined in Data.Has

Methods

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

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

hasLens :: Lens (a, b) a #

Has c (a, b, c) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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) 
Instance details

Defined in Data.Has

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 #

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

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

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

Polymorphic version of has'

Minimal complete definition

hadLens

Associated Types

type Replaced a b s Source #

Methods

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

Instances
UniqueMember x xs => Had x (Many xs) Source # 
Instance details

Defined in Data.Diverse.Lens.Many

Associated Types

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

Methods

hadLens :: 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 hasL) and replaceL (set hasL) in Lens' form.

let x = (5 :: Int) ./ Tagged @Foo False ./ Tagged @Bar 'X' ./ nil
x ^. hasL' @Foo `shouldBe` Tagged @Foo False
(x & hasL' @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 => hasL' l a Foo where hasL' = field l default hasL' :: forall (l :: Symbol) a s. (HasField' l s a) => Lens' s a hasL' = field @l

Minimal complete definition

hasL

Methods

hasL :: Lens' s a Source #

Instances
(UniqueLabelMember l xs, x ~ KindAtLabel l xs) => HasL (l :: k) x (Many xs) Source # 
Instance details

Defined in Data.Diverse.Lens.Many

Methods

hasL :: Lens' (Many xs) x 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 hasL'

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

Minimal complete definition

hadL

Associated Types

type ReplacedL l a b s Source #

Methods

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

Instances
(UniqueLabelMember l xs, x ~ KindAtLabel l xs) => HadL (l :: k) x (Many xs) Source # 
Instance details

Defined in Data.Diverse.Lens.Many

Associated Types

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

Methods

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

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

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

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

Minimal complete definition

hasN

Methods

hasN :: Lens' s a Source #

Instances
MemberAt n x xs => HasN n x (Many xs) Source # 
Instance details

Defined in Data.Diverse.Lens.Many

Methods

hasN :: 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 hasN'

Minimal complete definition

hadN

Associated Types

type ReplacedN n a b s Source #

Methods

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

Instances
MemberAt n x xs => HadN n x (Many xs) Source # 
Instance details

Defined in Data.Diverse.Lens.Many

Associated Types

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

Methods

hadN :: 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 # 
Instance details

Methods

getter :: Many xs -> x #

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

hasLens :: Lens (Many xs) x #