module Control.Lens.Tuple
(
Field1(..)
, Field2(..)
, Field3(..)
, Field4(..)
, Field5(..)
, Field6(..)
, Field7(..)
, Field8(..)
, Field9(..)
) where
import Control.Lens.Type
import Data.Functor
class Field1 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_1 :: Lens a b c d
instance Field1 (a,b) (a',b) a a' where
_1 k (a,b) = (\a' -> (a',b)) <$> k a
instance Field1 (a,b,c) (a',b,c) a a' where
_1 k (a,b,c) = (\a' -> (a',b,c)) <$> k a
instance Field1 (a,b,c,d) (a',b,c,d) a a' where
_1 k (a,b,c,d) = (\a' -> (a',b,c,d)) <$> k a
instance Field1 (a,b,c,d,e) (a',b,c,d,e) a a' where
_1 k (a,b,c,d,e) = (\a' -> (a',b,c,d,e)) <$> k a
instance Field1 (a,b,c,d,e,f) (a',b,c,d,e,f) a a' where
_1 k (a,b,c,d,e,f) = (\a' -> (a',b,c,d,e,f)) <$> k a
instance Field1 (a,b,c,d,e,f,g) (a',b,c,d,e,f,g) a a' where
_1 k (a,b,c,d,e,f,g) = (\a' -> (a',b,c,d,e,f,g)) <$> k a
instance Field1 (a,b,c,d,e,f,g,h) (a',b,c,d,e,f,g,h) a a' where
_1 k (a,b,c,d,e,f,g,h) = (\a' -> (a',b,c,d,e,f,g,h)) <$> k a
instance Field1 (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a' where
_1 k (a,b,c,d,e,f,g,h,i) = (\a' -> (a',b,c,d,e,f,g,h,i)) <$> k a
class Field2 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_2 :: Lens a b c d
instance Field2 (a,b) (a,b') b b' where
_2 k (a,b) = (\b' -> (a,b')) <$> k b
instance Field2 (a,b,c) (a,b',c) b b' where
_2 k (a,b,c) = (\b' -> (a,b',c)) <$> k b
instance Field2 (a,b,c,d) (a,b',c,d) b b' where
_2 k (a,b,c,d) = (\b' -> (a,b',c,d)) <$> k b
instance Field2 (a,b,c,d,e) (a,b',c,d,e) b b' where
_2 k (a,b,c,d,e) = (\b' -> (a,b',c,d,e)) <$> k b
instance Field2 (a,b,c,d,e,f) (a,b',c,d,e,f) b b' where
_2 k (a,b,c,d,e,f) = (\b' -> (a,b',c,d,e,f)) <$> k b
instance Field2 (a,b,c,d,e,f,g) (a,b',c,d,e,f,g) b b' where
_2 k (a,b,c,d,e,f,g) = (\b' -> (a,b',c,d,e,f,g)) <$> k b
instance Field2 (a,b,c,d,e,f,g,h) (a,b',c,d,e,f,g,h) b b' where
_2 k (a,b,c,d,e,f,g,h) = (\b' -> (a,b',c,d,e,f,g,h)) <$> k b
instance Field2 (a,b,c,d,e,f,g,h,i) (a,b',c,d,e,f,g,h,i) b b' where
_2 k (a,b,c,d,e,f,g,h,i) = (\b' -> (a,b',c,d,e,f,g,h,i)) <$> k b
class Field3 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_3 :: Lens a b c d
instance Field3 (a,b,c) (a,b,c') c c' where
_3 k (a,b,c) = (\c' -> (a,b,c')) <$> k c
instance Field3 (a,b,c,d) (a,b,c',d) c c' where
_3 k (a,b,c,d) = (\c' -> (a,b,c',d)) <$> k c
instance Field3 (a,b,c,d,e) (a,b,c',d,e) c c' where
_3 k (a,b,c,d,e) = (\c' -> (a,b,c',d,e)) <$> k c
instance Field3 (a,b,c,d,e,f) (a,b,c',d,e,f) c c' where
_3 k (a,b,c,d,e,f) = (\c' -> (a,b,c',d,e,f)) <$> k c
instance Field3 (a,b,c,d,e,f,g) (a,b,c',d,e,f,g) c c' where
_3 k (a,b,c,d,e,f,g) = (\c' -> (a,b,c',d,e,f,g)) <$> k c
instance Field3 (a,b,c,d,e,f,g,h) (a,b,c',d,e,f,g,h) c c' where
_3 k (a,b,c,d,e,f,g,h) = (\c' -> (a,b,c',d,e,f,g,h)) <$> k c
instance Field3 (a,b,c,d,e,f,g,h,i) (a,b,c',d,e,f,g,h,i) c c' where
_3 k (a,b,c,d,e,f,g,h,i) = (\c' -> (a,b,c',d,e,f,g,h,i)) <$> k c
class Field4 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_4 :: Lens a b c d
instance Field4 (a,b,c,d) (a,b,c,d') d d' where
_4 k (a,b,c,d) = (\d' -> (a,b,c,d')) <$> k d
instance Field4 (a,b,c,d,e) (a,b,c,d',e) d d' where
_4 k (a,b,c,d,e) = (\d' -> (a,b,c,d',e)) <$> k d
instance Field4 (a,b,c,d,e,f) (a,b,c,d',e,f) d d' where
_4 k (a,b,c,d,e,f) = (\d' -> (a,b,c,d',e,f)) <$> k d
instance Field4 (a,b,c,d,e,f,g) (a,b,c,d',e,f,g) d d' where
_4 k (a,b,c,d,e,f,g) = (\d' -> (a,b,c,d',e,f,g)) <$> k d
instance Field4 (a,b,c,d,e,f,g,h) (a,b,c,d',e,f,g,h) d d' where
_4 k (a,b,c,d,e,f,g,h) = (\d' -> (a,b,c,d',e,f,g,h)) <$> k d
instance Field4 (a,b,c,d,e,f,g,h,i) (a,b,c,d',e,f,g,h,i) d d' where
_4 k (a,b,c,d,e,f,g,h,i) = (\d' -> (a,b,c,d',e,f,g,h,i)) <$> k d
class Field5 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_5 :: Lens a b c d
instance Field5 (a,b,c,d,e) (a,b,c,d,e') e e' where
_5 k (a,b,c,d,e) = (\e' -> (a,b,c,d,e')) <$> k e
instance Field5 (a,b,c,d,e,f) (a,b,c,d,e',f) e e' where
_5 k (a,b,c,d,e,f) = (\e' -> (a,b,c,d,e',f)) <$> k e
instance Field5 (a,b,c,d,e,f,g) (a,b,c,d,e',f,g) e e' where
_5 k (a,b,c,d,e,f,g) = (\e' -> (a,b,c,d,e',f,g)) <$> k e
instance Field5 (a,b,c,d,e,f,g,h) (a,b,c,d,e',f,g,h) e e' where
_5 k (a,b,c,d,e,f,g,h) = (\e' -> (a,b,c,d,e',f,g,h)) <$> k e
instance Field5 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e',f,g,h,i) e e' where
_5 k (a,b,c,d,e,f,g,h,i) = (\e' -> (a,b,c,d,e',f,g,h,i)) <$> k e
class Field6 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_6 :: Lens a b c d
instance Field6 (a,b,c,d,e,f) (a,b,c,d,e,f') f f' where
_6 k (a,b,c,d,e,f) = (\f' -> (a,b,c,d,e,f')) <$> k f
instance Field6 (a,b,c,d,e,f,g) (a,b,c,d,e,f',g) f f' where
_6 k (a,b,c,d,e,f,g) = (\f' -> (a,b,c,d,e,f',g)) <$> k f
instance Field6 (a,b,c,d,e,f,g,h) (a,b,c,d,e,f',g,h) f f' where
_6 k (a,b,c,d,e,f,g,h) = (\f' -> (a,b,c,d,e,f',g,h)) <$> k f
instance Field6 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f',g,h,i) f f' where
_6 k (a,b,c,d,e,f,g,h,i) = (\f' -> (a,b,c,d,e,f',g,h,i)) <$> k f
class Field7 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_7 :: Lens a b c d
instance Field7 (a,b,c,d,e,f,g) (a,b,c,d,e,f,g') g g' where
_7 k (a,b,c,d,e,f,g) = (\g' -> (a,b,c,d,e,f,g')) <$> k g
instance Field7 (a,b,c,d,e,f,g,h) (a,b,c,d,e,f,g',h) g g' where
_7 k (a,b,c,d,e,f,g,h) = (\g' -> (a,b,c,d,e,f,g',h)) <$> k g
instance Field7 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f,g',h,i) g g' where
_7 k (a,b,c,d,e,f,g,h,i) = (\g' -> (a,b,c,d,e,f,g',h,i)) <$> k g
class Field8 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_8 :: Lens a b c d
instance Field8 (a,b,c,d,e,f,g,h) (a,b,c,d,e,f,g,h') h h' where
_8 k (a,b,c,d,e,f,g,h) = (\h' -> (a,b,c,d,e,f,g,h')) <$> k h
instance Field8 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f,g,h',i) h h' where
_8 k (a,b,c,d,e,f,g,h,i) = (\h' -> (a,b,c,d,e,f,g,h',i)) <$> k h
class Field9 a b c d | a -> c, b -> d, a d -> b, b c -> a where
_9 :: Lens a b c d
instance Field9 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f,g,h,i') i i' where
_9 k (a,b,c,d,e,f,g,h,i) = (\i' -> (a,b,c,d,e,f,g,h,i')) <$> k i