{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE PolyKinds #-}

#include "lens-common.h"

-------------------------------------------------------------------------------
-- |
-- Module      :  Control.Lens.Tuple
-- Copyright   :  (C) 2012-16 Edward Kmett
-- License     :  BSD-style (see the file LICENSE)
-- Maintainer  :  Edward Kmett <ekmett@gmail.com>
-- Stability   :  provisional
-- Portability :  Rank2Types
--
-------------------------------------------------------------------------------
module Control.Lens.Tuple
  (
  -- * Tuples
    Field1(..)
  , Field2(..)
  , Field3(..)
  , Field4(..)
  , Field5(..)
  , Field6(..)
  , Field7(..)
  , Field8(..)
  , Field9(..)
  , Field10(..)
  , Field11(..)
  , Field12(..)
  , Field13(..)
  , Field14(..)
  , Field15(..)
  , Field16(..)
  , Field17(..)
  , Field18(..)
  , Field19(..)
  -- * Strict variations
  , _1', _2', _3', _4', _5', _6', _7', _8', _9'
  , _10', _11', _12', _13', _14', _15', _16'
  , _17', _18', _19'
  ) where

import           Prelude ()
import           Control.Lens.Lens
import           Control.Lens.Internal.Prelude
import           Data.Functor.Product  (Product (..))
import           Data.Strict           (Pair (..))
import           GHC.Generics          ((:*:) (..), Generic (..), K1 (..),
                                        M1 (..), U1 (..))

-- $setup
-- >>> :set -XNoOverloadedStrings
-- >>> import Control.Lens

-- | Provides access to 1st field of a tuple.
class Field1 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 1st field of a tuple (and possibly change its type).
  --
  -- >>> (1,2)^._1
  -- 1
  --
  -- >>> _1 .~ "hello" $ (1,2)
  -- ("hello",2)
  --
  -- >>> (1,2) & _1 .~ "hello"
  -- ("hello",2)
  --
  -- >>> _1 putStrLn ("hello","world")
  -- hello
  -- ((),"world")
  --
  -- This can also be used on larger tuples as well:
  --
  -- >>> (1,2,3,4,5) & _1 +~ 41
  -- (42,2,3,4,5)
  --
  -- @
  -- '_1' :: 'Lens' (a,b) (a',b) a a'
  -- '_1' :: 'Lens' (a,b,c) (a',b,c) a a'
  -- '_1' :: 'Lens' (a,b,c,d) (a',b,c,d) a a'
  -- ...
  -- '_1' :: 'Lens' (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a'
  -- @
  _1 :: Lens s t a b
  default _1 :: (Generic s, Generic t, GIxed N0 (Rep s) (Rep t) a b)
             => Lens s t a b
  _1 = Proxy N0 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N0
proxyN0
  {-# INLINE _1 #-}

instance Field1 (Identity a) (Identity b) a b where
  _1 :: (a -> f b) -> Identity a -> f (Identity b)
_1 a -> f b
f (Identity a
a) = b -> Identity b
forall a. a -> Identity a
Identity (b -> Identity b) -> f b -> f (Identity b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f b
f a
a

instance Field1 (Product f g a) (Product f' g a) (f a) (f' a) where
  _1 :: (f a -> f (f' a)) -> Product f g a -> f (Product f' g a)
_1 f a -> f (f' a)
f (Pair f a
a g a
b) = (f' a -> g a -> Product f' g a) -> g a -> f' a -> Product f' g a
forall a b c. (a -> b -> c) -> b -> a -> c
flip f' a -> g a -> Product f' g a
forall k (f :: k -> *) (g :: k -> *) (a :: k).
f a -> g a -> Product f g a
Pair g a
b (f' a -> Product f' g a) -> f (f' a) -> f (Product f' g a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f a -> f (f' a)
f f a
a

instance Field1 ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) where
  _1 :: (f p -> f (f' p)) -> (:*:) f g p -> f ((:*:) f' g p)
_1 f p -> f (f' p)
f (f p
l :*: g p
r) = (f' p -> g p -> (:*:) f' g p
forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*: g p
r) (f' p -> (:*:) f' g p) -> f (f' p) -> f ((:*:) f' g p)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f p -> f (f' p)
f f p
l

-- | @since 4.20
instance Field1 (Pair a b) (Pair a' b) a a' where
  _1 :: (a -> f a') -> Pair a b -> f (Pair a' b)
_1 a -> f a'
f (a
a :!: b
b) = (a' -> b -> Pair a' b
forall a b. a -> b -> Pair a b
:!: b
b) (a' -> Pair a' b) -> f a' -> f (Pair a' b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f a'
f a
a

-- | @
-- '_1' k ~(a,b) = (\\a' -> (a',b)) 'Data.Functor.<$>' k a
-- @
instance Field1 (a,b) (a',b) a a' where
  _1 :: (a -> f a') -> (a, b) -> f (a', b)
_1 a -> f a'
k ~(a
a,b
b) = a -> f a'
k a
a f a' -> (a' -> (a', b)) -> f (a', b)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b)
  {-# INLINE _1 #-}

instance Field1 (a,b,c) (a',b,c) a a' where
  _1 :: (a -> f a') -> (a, b, c) -> f (a', b, c)
_1 a -> f a'
k ~(a
a,b
b,c
c) = a -> f a'
k a
a f a' -> (a' -> (a', b, c)) -> f (a', b, c)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d) (a',b,c,d) a a' where
  _1 :: (a -> f a') -> (a, b, c, d) -> f (a', b, c, d)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d) = a -> f a'
k a
a f a' -> (a' -> (a', b, c, d)) -> f (a', b, c, d)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e) (a',b,c,d,e) a a' where
  _1 :: (a -> f a') -> (a, b, c, d, e) -> f (a', b, c, d, e)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e) = a -> f a'
k a
a f a' -> (a' -> (a', b, c, d, e)) -> f (a', b, c, d, e)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f) (a',b,c,d,e,f) a a' where
  _1 :: (a -> f a') -> (a, b, c, d, e, f) -> f (a', b, c, d, e, f)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = a -> f a'
k a
a f a' -> (a' -> (a', b, c, d, e, f)) -> f (a', b, c, d, e, f)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g) (a',b,c,d,e,f,g) a a' where
  _1 :: (a -> f a') -> (a, b, c, d, e, f, g) -> f (a', b, c, d, e, f, g)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = a -> f a'
k a
a f a' -> (a' -> (a', b, c, d, e, f, g)) -> f (a', b, c, d, e, f, g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h) (a',b,c,d,e,f,g,h) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h) -> f (a', b, c, d, e, f, g, h)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h)) -> f (a', b, c, d, e, f, g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i) -> f (a', b, c, d, e, f, g, h, i)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i))
-> f (a', b, c, d, e, f, g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j) (a',b,c,d,e,f,g,h,i,j) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a', b, c, d, e, f, g, h, i, j)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j))
-> f (a', b, c, d, e, f, g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk) (a',b,c,d,e,f,g,h,i,j,kk) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a', b, c, d, e, f, g, h, i, j, kk)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk))
-> f (a', b, c, d, e, f, g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l) (a',b,c,d,e,f,g,h,i,j,kk,l) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m) (a',b,c,d,e,f,g,h,i,j,kk,l,m) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n,o) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r) = a -> f a'
k a
a f a'
-> (a' -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r)
  {-# INLINE _1 #-}

instance Field1 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) (a',b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) a a' where
  _1 :: (a -> f a')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
_1 a -> f a'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s) = a -> f a'
k a
a f a'
-> (a'
    -> (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s))
-> f (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a'
a' -> (a'
a',b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s)
  {-# INLINE _1 #-}

-- | Provides access to the 2nd field of a tuple.
class Field2 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 2nd field of a tuple.
  --
  -- >>> _2 .~ "hello" $ (1,(),3,4)
  -- (1,"hello",3,4)
  --
  -- >>> (1,2,3,4) & _2 *~ 3
  -- (1,6,3,4)
  --
  -- >>> _2 print (1,2)
  -- 2
  -- (1,())
  --
  -- @
  -- 'Control.Lens.Fold.anyOf' '_2' :: (s -> 'Bool') -> (a, s) -> 'Bool'
  -- 'Data.Traversable.traverse' '.' '_2' :: ('Control.Applicative.Applicative' f, 'Data.Traversable.Traversable' t) => (a -> f b) -> t (s, a) -> f (t (s, b))
  -- 'Control.Lens.Fold.foldMapOf' ('Data.Traversable.traverse' '.' '_2') :: ('Data.Traversable.Traversable' t, 'Data.Monoid.Monoid' m) => (s -> m) -> t (b, s) -> m
  -- @
  _2 :: Lens s t a b
  default _2 :: (Generic s, Generic t, GIxed N1 (Rep s) (Rep t) a b)
             => Lens s t a b
  _2 = Proxy N1 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N1
proxyN1
  {-# INLINE _2 #-}

instance Field2 (Product f g a) (Product f g' a) (g a) (g' a) where
  _2 :: (g a -> f (g' a)) -> Product f g a -> f (Product f g' a)
_2 g a -> f (g' a)
f (Pair f a
a g a
b) = f a -> g' a -> Product f g' a
forall k (f :: k -> *) (g :: k -> *) (a :: k).
f a -> g a -> Product f g a
Pair f a
a (g' a -> Product f g' a) -> f (g' a) -> f (Product f g' a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> g a -> f (g' a)
f g a
b

instance Field2 ((f :*: g) p) ((f :*: g') p) (g p) (g' p) where
  _2 :: (g p -> f (g' p)) -> (:*:) f g p -> f ((:*:) f g' p)
_2 g p -> f (g' p)
f (f p
l :*: g p
r) = (f p
l f p -> g' p -> (:*:) f g' p
forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*:) (g' p -> (:*:) f g' p) -> f (g' p) -> f ((:*:) f g' p)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> g p -> f (g' p)
f g p
r

-- | @since 4.20
instance Field2 (Pair a b) (Pair a b') b b' where
  _2 :: (b -> f b') -> Pair a b -> f (Pair a b')
_2 b -> f b'
f (a
a :!: b
b) = (a
a a -> b' -> Pair a b'
forall a b. a -> b -> Pair a b
:!:) (b' -> Pair a b') -> f b' -> f (Pair a b')
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> f b'
f b
b

-- | @
-- '_2' k ~(a,b) = (\\b' -> (a,b')) 'Data.Functor.<$>' k b
-- @
instance Field2 (a,b) (a,b') b b' where
  _2 :: (b -> f b') -> (a, b) -> f (a, b')
_2 b -> f b'
k ~(a
a,b
b) = b -> f b'
k b
b f b' -> (b' -> (a, b')) -> f (a, b')
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b')
  {-# INLINE _2 #-}

instance Field2 (a,b,c) (a,b',c) b b' where
  _2 :: (b -> f b') -> (a, b, c) -> f (a, b', c)
_2 b -> f b'
k ~(a
a,b
b,c
c) = b -> f b'
k b
b f b' -> (b' -> (a, b', c)) -> f (a, b', c)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d) (a,b',c,d) b b' where
  _2 :: (b -> f b') -> (a, b, c, d) -> f (a, b', c, d)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d) = b -> f b'
k b
b f b' -> (b' -> (a, b', c, d)) -> f (a, b', c, d)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e) (a,b',c,d,e) b b' where
  _2 :: (b -> f b') -> (a, b, c, d, e) -> f (a, b', c, d, e)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e) = b -> f b'
k b
b f b' -> (b' -> (a, b', c, d, e)) -> f (a, b', c, d, e)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f) (a,b',c,d,e,f) b b' where
  _2 :: (b -> f b') -> (a, b, c, d, e, f) -> f (a, b', c, d, e, f)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = b -> f b'
k b
b f b' -> (b' -> (a, b', c, d, e, f)) -> f (a, b', c, d, e, f)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g) (a,b',c,d,e,f,g) b b' where
  _2 :: (b -> f b') -> (a, b, c, d, e, f, g) -> f (a, b', c, d, e, f, g)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = b -> f b'
k b
b f b' -> (b' -> (a, b', c, d, e, f, g)) -> f (a, b', c, d, e, f, g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h) (a,b',c,d,e,f,g,h) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h) -> f (a, b', c, d, e, f, g, h)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h)) -> f (a, b', c, d, e, f, g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i) (a,b',c,d,e,f,g,h,i) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i) -> f (a, b', c, d, e, f, g, h, i)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i))
-> f (a, b', c, d, e, f, g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j) (a,b',c,d,e,f,g,h,i,j) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a, b', c, d, e, f, g, h, i, j)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j))
-> f (a, b', c, d, e, f, g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk) (a,b',c,d,e,f,g,h,i,j,kk) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a, b', c, d, e, f, g, h, i, j, kk)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk))
-> f (a, b', c, d, e, f, g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l) (a,b',c,d,e,f,g,h,i,j,kk,l) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m) (a,b',c,d,e,f,g,h,i,j,kk,l,m) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n,o) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n,o,p) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r) = b -> f b'
k b
b f b'
-> (b' -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r)
  {-# INLINE _2 #-}

instance Field2 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) (a,b',c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) b b' where
  _2 :: (b -> f b')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
_2 b -> f b'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s) = b -> f b'
k b
b f b'
-> (b'
    -> (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s))
-> f (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b'
b' -> (a
a,b'
b',c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s)
  {-# INLINE _2 #-}


-- | Provides access to the 3rd field of a tuple.
class Field3 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 3rd field of a tuple.
  _3 :: Lens s t a b
  default _3 :: (Generic s, Generic t, GIxed N2 (Rep s) (Rep t) a b)
             => Lens s t a b
  _3 = Proxy N2 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N2
proxyN2
  {-# INLINE _3 #-}

instance Field3 (a,b,c) (a,b,c') c c' where
  _3 :: (c -> f c') -> (a, b, c) -> f (a, b, c')
_3 c -> f c'
k ~(a
a,b
b,c
c) = c -> f c'
k c
c f c' -> (c' -> (a, b, c')) -> f (a, b, c')
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c')
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d) (a,b,c',d) c c' where
  _3 :: (c -> f c') -> (a, b, c, d) -> f (a, b, c', d)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d) = c -> f c'
k c
c f c' -> (c' -> (a, b, c', d)) -> f (a, b, c', d)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e) (a,b,c',d,e) c c' where
  _3 :: (c -> f c') -> (a, b, c, d, e) -> f (a, b, c', d, e)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e) = c -> f c'
k c
c f c' -> (c' -> (a, b, c', d, e)) -> f (a, b, c', d, e)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f) (a,b,c',d,e,f) c c' where
  _3 :: (c -> f c') -> (a, b, c, d, e, f) -> f (a, b, c', d, e, f)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = c -> f c'
k c
c f c' -> (c' -> (a, b, c', d, e, f)) -> f (a, b, c', d, e, f)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g) (a,b,c',d,e,f,g) c c' where
  _3 :: (c -> f c') -> (a, b, c, d, e, f, g) -> f (a, b, c', d, e, f, g)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = c -> f c'
k c
c f c' -> (c' -> (a, b, c', d, e, f, g)) -> f (a, b, c', d, e, f, g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h) (a,b,c',d,e,f,g,h) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h) -> f (a, b, c', d, e, f, g, h)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h)) -> f (a, b, c', d, e, f, g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i) (a,b,c',d,e,f,g,h,i) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i) -> f (a, b, c', d, e, f, g, h, i)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i))
-> f (a, b, c', d, e, f, g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j) (a,b,c',d,e,f,g,h,i,j) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a, b, c', d, e, f, g, h, i, j)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j))
-> f (a, b, c', d, e, f, g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk) (a,b,c',d,e,f,g,h,i,j,kk) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a, b, c', d, e, f, g, h, i, j, kk)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk))
-> f (a, b, c', d, e, f, g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l) (a,b,c',d,e,f,g,h,i,j,kk,l) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m) (a,b,c',d,e,f,g,h,i,j,kk,l,m) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n,o) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n,o,p) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n,o,p,q) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r) = c -> f c'
k c
c f c'
-> (c' -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r)
  {-# INLINE _3 #-}

instance Field3 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) (a,b,c',d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) c c' where
  _3 :: (c -> f c')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
_3 c -> f c'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s) = c -> f c'
k c
c f c'
-> (c'
    -> (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s))
-> f (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \c'
c' -> (a
a,b
b,c'
c',d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s)
  {-# INLINE _3 #-}

-- | Provide access to the 4th field of a tuple.
class Field4 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 4th field of a tuple.
  _4 :: Lens s t a b
  default _4 :: (Generic s, Generic t, GIxed N3 (Rep s) (Rep t) a b)
             => Lens s t a b
  _4 = Proxy N3 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N3
proxyN3
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d) (a,b,c,d') d d' where
  _4 :: (d -> f d') -> (a, b, c, d) -> f (a, b, c, d')
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d) = d -> f d'
k d
d f d' -> (d' -> (a, b, c, d')) -> f (a, b, c, d')
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d')
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e) (a,b,c,d',e) d d' where
  _4 :: (d -> f d') -> (a, b, c, d, e) -> f (a, b, c, d', e)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e) = d -> f d'
k d
d f d' -> (d' -> (a, b, c, d', e)) -> f (a, b, c, d', e)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f) (a,b,c,d',e,f) d d' where
  _4 :: (d -> f d') -> (a, b, c, d, e, f) -> f (a, b, c, d', e, f)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = d -> f d'
k d
d f d' -> (d' -> (a, b, c, d', e, f)) -> f (a, b, c, d', e, f)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g) (a,b,c,d',e,f,g) d d' where
  _4 :: (d -> f d') -> (a, b, c, d, e, f, g) -> f (a, b, c, d', e, f, g)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = d -> f d'
k d
d f d' -> (d' -> (a, b, c, d', e, f, g)) -> f (a, b, c, d', e, f, g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h) (a,b,c,d',e,f,g,h) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h) -> f (a, b, c, d', e, f, g, h)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h)) -> f (a, b, c, d', e, f, g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i) (a,b,c,d',e,f,g,h,i) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i) -> f (a, b, c, d', e, f, g, h, i)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i))
-> f (a, b, c, d', e, f, g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j) (a,b,c,d',e,f,g,h,i,j) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a, b, c, d', e, f, g, h, i, j)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j))
-> f (a, b, c, d', e, f, g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk) (a,b,c,d',e,f,g,h,i,j,kk) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a, b, c, d', e, f, g, h, i, j, kk)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk))
-> f (a, b, c, d', e, f, g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l) (a,b,c,d',e,f,g,h,i,j,kk,l) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m) (a,b,c,d',e,f,g,h,i,j,kk,l,m) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n,o) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n,o,p) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n,o,p,q) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n,o,p,q,r) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r) = d -> f d'
k d
d f d'
-> (d' -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r)
  {-# INLINE _4 #-}

instance Field4 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) (a,b,c,d',e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) d d' where
  _4 :: (d -> f d')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
_4 d -> f d'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s) = d -> f d'
k d
d f d'
-> (d'
    -> (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s))
-> f (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \d'
d' -> (a
a,b
b,c
c,d'
d',e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s)
  {-# INLINE _4 #-}

-- | Provides access to the 5th field of a tuple.
class Field5 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 5th field of a tuple.
  _5 :: Lens s t a b
  default _5 :: (Generic s, Generic t, GIxed N4 (Rep s) (Rep t) a b)
             => Lens s t a b
  _5 = Proxy N4 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N4
proxyN4
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e) (a,b,c,d,e') e e' where
  _5 :: (e -> f e') -> (a, b, c, d, e) -> f (a, b, c, d, e')
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e) = e -> f e'
k e
e f e' -> (e' -> (a, b, c, d, e')) -> f (a, b, c, d, e')
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e')
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f) (a,b,c,d,e',f) e e' where
  _5 :: (e -> f e') -> (a, b, c, d, e, f) -> f (a, b, c, d, e', f)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = e -> f e'
k e
e f e' -> (e' -> (a, b, c, d, e', f)) -> f (a, b, c, d, e', f)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g) (a,b,c,d,e',f,g) e e' where
  _5 :: (e -> f e') -> (a, b, c, d, e, f, g) -> f (a, b, c, d, e', f, g)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = e -> f e'
k e
e f e' -> (e' -> (a, b, c, d, e', f, g)) -> f (a, b, c, d, e', f, g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h) (a,b,c,d,e',f,g,h) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h) -> f (a, b, c, d, e', f, g, h)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h)) -> f (a, b, c, d, e', f, g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e',f,g,h,i) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i) -> f (a, b, c, d, e', f, g, h, i)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i))
-> f (a, b, c, d, e', f, g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j) (a,b,c,d,e',f,g,h,i,j) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a, b, c, d, e', f, g, h, i, j)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j))
-> f (a, b, c, d, e', f, g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk) (a,b,c,d,e',f,g,h,i,j,kk) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a, b, c, d, e', f, g, h, i, j, kk)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk))
-> f (a, b, c, d, e', f, g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l) (a,b,c,d,e',f,g,h,i,j,kk,l) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m) (a,b,c,d,e',f,g,h,i,j,kk,l,m) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n,o) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n,o,p) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n,o,p,q) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n,o,p,q,r) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r) = e -> f e'
k e
e f e'
-> (e' -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r)
  {-# INLINE _5 #-}

instance Field5 (a,b,c,d,e,f,g,h,i,j,kk,l,m,n,o,p,q,r,s) (a,b,c,d,e',f,g,h,i,j,kk,l,m,n,o,p,q,r,s) e e' where
  _5 :: (e -> f e')
-> (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
_5 e -> f e'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s) = e -> f e'
k e
e f e'
-> (e'
    -> (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s))
-> f (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \e'
e' -> (a
a,b
b,c
c,d
d,e'
e',f
f,g
g,h
h,i
i,j
j,kk
kk,l
l,m
m,n
n,o
o,p
p,q
q,r
r,s
s)
  {-# INLINE _5 #-}

-- | Provides access to the 6th element of a tuple.
class Field6 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  -- | Access the 6th field of a tuple.
  _6 :: Lens s t a b
  default _6 :: (Generic s, Generic t, GIxed N5 (Rep s) (Rep t) a b)
             => Lens s t a b
  _6 = Proxy N5 -> Lens s t a b
forall k s t (n :: k) a b (f :: k -> *).
(Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) =>
f n -> Lens s t a b
ix Proxy N5
proxyN5
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f) (a,b,c,d,e,f') f f' where
  _6 :: (f -> f f') -> (a, b, c, d, e, f) -> f (a, b, c, d, e, f')
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f) = f -> f f'
k f
f f f' -> (f' -> (a, b, c, d, e, f')) -> f (a, b, c, d, e, f')
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f')
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f,g) (a,b,c,d,e,f',g) f f' where
  _6 :: (f -> f f') -> (a, b, c, d, e, f, g) -> f (a, b, c, d, e, f', g)
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g) = f -> f f'
k f
f f f' -> (f' -> (a, b, c, d, e, f', g)) -> f (a, b, c, d, e, f', g)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f',g
g)
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f,g,h) (a,b,c,d,e,f',g,h) f f' where
  _6 :: (f -> f f')
-> (a, b, c, d, e, f, g, h) -> f (a, b, c, d, e, f', g, h)
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h) = f -> f f'
k f
f f f'
-> (f' -> (a, b, c, d, e, f', g, h)) -> f (a, b, c, d, e, f', g, h)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f',g
g,h
h)
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f',g,h,i) f f' where
  _6 :: (f -> f f')
-> (a, b, c, d, e, f, g, h, i) -> f (a, b, c, d, e, f', g, h, i)
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i) = f -> f f'
k f
f f f'
-> (f' -> (a, b, c, d, e, f', g, h, i))
-> f (a, b, c, d, e, f', g, h, i)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f',g
g,h
h,i
i)
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f,g,h,i,j) (a,b,c,d,e,f',g,h,i,j) f f' where
  _6 :: (f -> f f')
-> (a, b, c, d, e, f, g, h, i, j)
-> f (a, b, c, d, e, f', g, h, i, j)
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j) = f -> f f'
k f
f f f'
-> (f' -> (a, b, c, d, e, f', g, h, i, j))
-> f (a, b, c, d, e, f', g, h, i, j)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f',g
g,h
h,i
i,j
j)
  {-# INLINE _6 #-}

instance Field6 (a,b,c,d,e,f,g,h,i,j,kk) (a,b,c,d,e,f',g,h,i,j,kk) f f' where
  _6 :: (f -> f f')
-> (a, b, c, d, e, f, g, h, i, j, kk)
-> f (a, b, c, d, e, f', g, h, i, j, kk)
_6 f -> f f'
k ~(a
a,b
b,c
c,d
d,e
e,f
f,g
g,h
h,i
i,j
j,kk
kk) = f -> f f'
k f
f f f'
-> (f' -> (a, b, c, d, e, f', g, h, i, j, kk))
-> f (a, b, c, d, e, f', g, h, i, j, kk)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \f'
f' -> (a
a,b
b,c
c,d
d,e
e,f'
f',g
g,h
h,i
i,j
j,kk
kk