@@ -1,237 +0,0 @@
1−{-# LANGUAGE RankNTypes #-}
2−{-# LANGUAGE TypeSynonymInstances #-}
3−{-# LANGUAGE DataKinds #-}
4−{-# LANGUAGE TypeOperators #-}
5−{-# LANGUAGE UndecidableInstances #-}
6−{-# LANGUAGE FlexibleInstances #-}
8−{-# LANGUAGE TypeFamilies #-}
9−{-# LANGUAGE TemplateHaskell #-}
10−{-# LANGUAGE StandaloneDeriving #-}
11−{-# LANGUAGE AllowAmbiguousTypes #-}
12−{-# LANGUAGE DeriveGeneric #-}
13−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
15−module Control.Ether.Flatten
20−import Control.DeepSeq
22−import GHC.Generics (Generic)
24−class HasLens tag outer inner | tag outer -> inner where
25− lensOf :: Lens' outer inner
27−data family Product :: [k] -> [*] -> *
29−data instance Product ts '[a1, a2, a3, a4] =
42− ) => Show (Product ts '[a1, a2, a3, a4])
49− ) => NFData (Product ts '[a1, a2, a3, a4])
51−instance a ~ a1 => HasLens t1
54− '[a1, a2, a3, a4]) a where
55− lensOf = lens p4_1 (\p a -> p{ p4_1 = a })
56− {-# INLINE lensOf #-}
58−instance a ~ a2 => HasLens t2
61− '[a1, a2, a3, a4]) a where
62− lensOf = lens p4_2 (\p a -> p{ p4_2 = a })
63− {-# INLINE lensOf #-}
65−instance a ~ a3 => HasLens t3
68− '[a1, a2, a3, a4]) a where
69− lensOf = lens p4_3 (\p a -> p{ p4_3 = a })
70− {-# INLINE lensOf #-}
72−instance a ~ a4 => HasLens t4
75− '[a1, a2, a3, a4]) a where
76− lensOf = lens p4_4 (\p a -> p{ p4_4 = a })
77− {-# INLINE lensOf #-}
79−data instance Product ts '[a1, a2, a3, a4, a5] =
94− ) => Show (Product ts '[a1, a2, a3, a4, a5])
102− ) => NFData (Product ts '[a1, a2, a3, a4, a5])
104−instance a ~ a1 => HasLens t1
106− '[t1, t2, t3, t4, t5]
107− '[a1, a2, a3, a4, a5]) a where
108− lensOf = lens p5_1 (\p a -> p{ p5_1 = a })
109− {-# INLINE lensOf #-}
111−instance a ~ a2 => HasLens t2
113− '[t1, t2, t3, t4, t5]
114− '[a1, a2, a3, a4, a5]) a where
115− lensOf = lens p5_2 (\p a -> p{ p5_2 = a })
116− {-# INLINE lensOf #-}
118−instance a ~ a3 => HasLens t3
120− '[t1, t2, t3, t4, t5]
121− '[a1, a2, a3, a4, a5]) a where
122− lensOf = lens p5_3 (\p a -> p{ p5_3 = a })
123− {-# INLINE lensOf #-}
125−instance a ~ a4 => HasLens t4
127− '[t1, t2, t3, t4, t5]
128− '[a1, a2, a3, a4, a5]) a where
129− lensOf = lens p5_4 (\p a -> p{ p5_4 = a })
130− {-# INLINE lensOf #-}
132−instance a ~ a5 => HasLens t5
134− '[t1, t2, t3, t4, t5]
135− '[a1, a2, a3, a4, a5]) a where
136− lensOf = lens p5_5 (\p a -> p{ p5_5 = a })
137− {-# INLINE lensOf #-}
139−data instance Product ts '[a1, a2, a3, a4, a5, a6, a7, a8, a9] =
150− } deriving (Generic)
162− ) => Show (Product ts '[a1, a2, a3, a4, a5, a6, a7, a8, a9])
174− ) => NFData (Product ts '[a1, a2, a3, a4, a5, a6, a7, a8, a9])
176−instance a ~ a1 => HasLens t1
178− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
179− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
180− lensOf = lens p9_1 (\p a -> p{ p9_1 = a })
181− {-# INLINE lensOf #-}
183−instance a ~ a2 => HasLens t2
185− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
186− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
187− lensOf = lens p9_2 (\p a -> p{ p9_2 = a })
188− {-# INLINE lensOf #-}
190−instance a ~ a3 => HasLens t3
192− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
193− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
194− lensOf = lens p9_3 (\p a -> p{ p9_3 = a })
195− {-# INLINE lensOf #-}
197−instance a ~ a4 => HasLens t4
199− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
200− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
201− lensOf = lens p9_4 (\p a -> p{ p9_4 = a })
202− {-# INLINE lensOf #-}
204−instance a ~ a5 => HasLens t5
206− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
207− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
208− lensOf = lens p9_5 (\p a -> p{ p9_5 = a })
209− {-# INLINE lensOf #-}
211−instance a ~ a6 => HasLens t6
213− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
214− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
215− lensOf = lens p9_6 (\p a -> p{ p9_6 = a })
216− {-# INLINE lensOf #-}
218−instance a ~ a7 => HasLens t7
220− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
221− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
222− lensOf = lens p9_7 (\p a -> p{ p9_7 = a })
223− {-# INLINE lensOf #-}
225−instance a ~ a8 => HasLens t8
227− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
228− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
229− lensOf = lens p9_8 (\p a -> p{ p9_8 = a })
230− {-# INLINE lensOf #-}
232−instance a ~ a9 => HasLens t9
234− '[t1, t2, t3, t4, t5, t6, t7, t8, t9]
235− '[a1, a2, a3, a4, a5, a6, a7, a8, a9]) a where
236− lensOf = lens p9_9 (\p a -> p{ p9_9 = a })
237− {-# INLINE lensOf #-}