-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lens.purs
416 lines (344 loc) · 15.8 KB
/
Lens.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
module Snapshots.PrimaryExample.Lens where
import Prelude
import Prim.Row
import Prim hiding (Char)
import Prim.Boolean hiding (True) as PB
import Data.Either (Either(..))
import Data.Lens (Lens')
import Data.Lens.Iso (Iso', iso)
import Data.Lens.Iso.Newtype (_Newtype)
import Data.Lens.Prism (Prism', prism)
import Data.Lens.Record (prop)
import Data.Tuple (Tuple(..))
import Prelude (Unit, const, identity, unit)
import Snapshots.Imports.ImportedExplicitTypesNoModuleAlias (MyAlias, MyData, MyNewtype)
import Snapshots.Imports.ImportedExplicitTypesWithModuleAlias as Shared
import Snapshots.Imports.ModuleAliasOnly as Q
import Snapshots.Imports.SharedModuleAlias as Shared
import Snapshots.PrimaryExample (AliasDefinedInSourceFile, FfiTypeDefinedInSourceFile, NewtypeDefinedInSourceFile, Newtype_TypeExported_CtorExported_All, Newtype_TypeExported_CtorExported_ByName, NewtypedRecord, NewtypedRecordWithTyVars, NewtypedType, Record_ImportedTypesAreReimported, TypeAlias_Record, TypeAlias_Type, TypeAlias_TypeExported, DataDefinedInSourceFile(..), Data_NoTyVars_Args0(..), Data_NoTyVars_Args1(..), Data_NoTyVars_Args2(..), Data_NoTyVars_Args3(..), Data_NoTyVars_Sum_Args0(..), Data_NoTyVars_Sum_Args1(..), Data_NoTyVars_Sum_Args2(..), Data_NoTyVars_Sum_Args3(..), Data_Product_ImportedTypesAreReimported(..), Data_Sum_ImportedTypesAreReimported(..), Data_TyVars_Args0(..), Data_TyVars_Args1(..), Data_TyVars_Args2(..), Data_TyVars_Args3(..), Data_TyVars_Sum_Args0(..), Data_TyVars_Sum_Args1(..), Data_TyVars_Sum_Args2(..), Data_TyVars_Sum_Args3(..), Data_TypeExported_CtorExported_Product_All(..), Data_TypeExported_CtorExported_Sum_All(..), Data_Wrapping_Record(..), EnsureSharedImportIsUsed(..), KindedTyVars(..))
import Type.Proxy (Proxy(..))
_Data_NoTyVars_Args0 :: Lens' Data_NoTyVars_Args0 Unit
_Data_NoTyVars_Args0 = iso (const unit) (const Data_NoTyVars_Args0)
_Data_NoTyVars_Args1 :: Lens' Data_NoTyVars_Args1 Int
_Data_NoTyVars_Args1 = iso (\(Data_NoTyVars_Args1 a) -> a) Data_NoTyVars_Args1
_Data_NoTyVars_Args2 :: Lens' Data_NoTyVars_Args2 (Tuple Int String)
_Data_NoTyVars_Args2 = iso (\(Data_NoTyVars_Args2 a b) -> Tuple a b) \(Tuple a b) ->
Data_NoTyVars_Args2 a b
_Data_NoTyVars_Args3 :: Lens' Data_NoTyVars_Args3 { arg1 :: Int, arg2 :: String, arg3 :: Boolean }
_Data_NoTyVars_Args3 = iso
(\(Data_NoTyVars_Args3 arg1 arg2 arg3) -> { arg1: arg1, arg2: arg2, arg3: arg3 })
\{ arg1, arg2, arg3 } -> Data_NoTyVars_Args3 arg1 arg2 arg3
_Data_TyVars_Args0 :: forall a b c d. Lens' (Data_TyVars_Args0 a b c d) Unit
_Data_TyVars_Args0 = iso (const unit) (const Data_TyVars_Args0)
_Data_TyVars_Args1 :: forall a b c d. Lens' (Data_TyVars_Args1 a b c d) a
_Data_TyVars_Args1 = iso (\(Data_TyVars_Args1 a) -> a) Data_TyVars_Args1
_Data_TyVars_Args2 :: forall a b c d. Lens' (Data_TyVars_Args2 a b c d) (Tuple a b)
_Data_TyVars_Args2 = iso (\(Data_TyVars_Args2 a b) -> Tuple a b) \(Tuple a b) -> Data_TyVars_Args2
a
b
_Data_TyVars_Args3
:: forall a b c d. Lens' (Data_TyVars_Args3 a b c d) { arg1 :: a, arg2 :: b, arg3 :: c }
_Data_TyVars_Args3 = iso
(\(Data_TyVars_Args3 arg1 arg2 arg3) -> { arg1: arg1, arg2: arg2, arg3: arg3 })
\{ arg1, arg2, arg3 } -> Data_TyVars_Args3 arg1 arg2 arg3
_Data_NoTyVars_Sum_Args0 :: Prism' Data_NoTyVars_Sum_Args0 Unit
_Data_NoTyVars_Sum_Args0 = prism (const Data_NoTyVars_Sum_Args0) case _ of
Data_NoTyVars_Sum_Args0 -> Right unit
other -> Left other
_Data_NoTyVars_Sum_Args0_Ignored :: Prism' Data_NoTyVars_Sum_Args0 Unit
_Data_NoTyVars_Sum_Args0_Ignored = prism (const Data_NoTyVars_Sum_Args0_Ignored) case _ of
Data_NoTyVars_Sum_Args0_Ignored -> Right unit
other -> Left other
_Data_NoTyVars_Sum_Args1 :: Prism' Data_NoTyVars_Sum_Args1 Int
_Data_NoTyVars_Sum_Args1 = prism Data_NoTyVars_Sum_Args1 case _ of
Data_NoTyVars_Sum_Args1 a -> Right a
other -> Left other
_Data_NoTyVars_Sum_Args1_Ignored :: Prism' Data_NoTyVars_Sum_Args1 Unit
_Data_NoTyVars_Sum_Args1_Ignored = prism (const Data_NoTyVars_Sum_Args1_Ignored) case _ of
Data_NoTyVars_Sum_Args1_Ignored -> Right unit
other -> Left other
_Data_NoTyVars_Sum_Args2 :: Prism' Data_NoTyVars_Sum_Args2 (Tuple Int Int)
_Data_NoTyVars_Sum_Args2 = prism (\(Tuple a b) -> Data_NoTyVars_Sum_Args2 a b) case _ of
Data_NoTyVars_Sum_Args2 a b -> Right (Tuple a b)
other -> Left other
_Data_NoTyVars_Sum_Args2_Ignored :: Prism' Data_NoTyVars_Sum_Args2 Unit
_Data_NoTyVars_Sum_Args2_Ignored = prism (const Data_NoTyVars_Sum_Args2_Ignored) case _ of
Data_NoTyVars_Sum_Args2_Ignored -> Right unit
other -> Left other
_Data_NoTyVars_Sum_Args3 :: Prism' Data_NoTyVars_Sum_Args3
{ arg1 :: Int, arg2 :: Int, arg3 :: Int }
_Data_NoTyVars_Sum_Args3 = prism (\{ arg1, arg2, arg3 } -> Data_NoTyVars_Sum_Args3 arg1 arg2 arg3)
case _ of
Data_NoTyVars_Sum_Args3 arg1 arg2 arg3 -> Right { arg1: arg1, arg2: arg2, arg3: arg3 }
other -> Left other
_Data_NoTyVars_Sum_Args3_Ignored :: Prism' Data_NoTyVars_Sum_Args3 Unit
_Data_NoTyVars_Sum_Args3_Ignored = prism (const Data_NoTyVars_Sum_Args3_Ignored) case _ of
Data_NoTyVars_Sum_Args3_Ignored -> Right unit
other -> Left other
_Data_TyVars_Sum_Args0 :: forall a b c d. Prism' (Data_TyVars_Sum_Args0 a b c d) Unit
_Data_TyVars_Sum_Args0 = prism (const Data_TyVars_Sum_Args0) case _ of
Data_TyVars_Sum_Args0 -> Right unit
other -> Left other
_Data_TyVars_Sum_Args0_Ignored :: forall a b c d. Prism' (Data_TyVars_Sum_Args0 a b c d) Unit
_Data_TyVars_Sum_Args0_Ignored = prism (const Data_TyVars_Sum_Args0_Ignored) case _ of
Data_TyVars_Sum_Args0_Ignored -> Right unit
other -> Left other
_Data_TyVars_Sum_Args1 :: forall a b c d. Prism' (Data_TyVars_Sum_Args1 a b c d) a
_Data_TyVars_Sum_Args1 = prism Data_TyVars_Sum_Args1 case _ of
Data_TyVars_Sum_Args1 a -> Right a
other -> Left other
_Data_TyVars_Sum_Args1_Ignored :: forall a b c d. Prism' (Data_TyVars_Sum_Args1 a b c d) Unit
_Data_TyVars_Sum_Args1_Ignored = prism (const Data_TyVars_Sum_Args1_Ignored) case _ of
Data_TyVars_Sum_Args1_Ignored -> Right unit
other -> Left other
_Data_TyVars_Sum_Args2 :: forall a b c d. Prism' (Data_TyVars_Sum_Args2 a b c d) (Tuple a b)
_Data_TyVars_Sum_Args2 = prism (\(Tuple a b) -> Data_TyVars_Sum_Args2 a b) case _ of
Data_TyVars_Sum_Args2 a b -> Right (Tuple a b)
other -> Left other
_Data_TyVars_Sum_Args2_Ignored :: forall a b c d. Prism' (Data_TyVars_Sum_Args2 a b c d) Unit
_Data_TyVars_Sum_Args2_Ignored = prism (const Data_TyVars_Sum_Args2_Ignored) case _ of
Data_TyVars_Sum_Args2_Ignored -> Right unit
other -> Left other
_Data_TyVars_Sum_Args3
:: forall a b c d. Prism' (Data_TyVars_Sum_Args3 a b c d) { arg1 :: a, arg2 :: b, arg3 :: c }
_Data_TyVars_Sum_Args3 = prism (\{ arg1, arg2, arg3 } -> Data_TyVars_Sum_Args3 arg1 arg2 arg3)
case _ of
Data_TyVars_Sum_Args3 arg1 arg2 arg3 -> Right { arg1: arg1, arg2: arg2, arg3: arg3 }
other -> Left other
_Data_TyVars_Sum_Args3_Ignored :: forall a b c d. Prism' (Data_TyVars_Sum_Args3 a b c d) Unit
_Data_TyVars_Sum_Args3_Ignored = prism (const Data_TyVars_Sum_Args3_Ignored) case _ of
Data_TyVars_Sum_Args3_Ignored -> Right unit
other -> Left other
_Data_Wrapping_Record
:: forall a b c
. Lens' (Data_Wrapping_Record a b c)
{ recordFieldReferencedInExportedData :: a
}
_Data_Wrapping_Record = iso (\(Data_Wrapping_Record a) -> a) Data_Wrapping_Record
_TypeAlias_Record :: Iso' TypeAlias_Record
{ recordFieldReferencedInExportedTypeAlias :: Int
, bar :: String
, baz :: Boolean
}
_TypeAlias_Record = identity
_TypeAlias_Type :: Iso' TypeAlias_Type String
_TypeAlias_Type = identity
_NewtypedRecord :: Lens' NewtypedRecord
{ first :: String
, second :: String
}
_NewtypedRecord = _Newtype
_NewtypedRecordWithTyVars
:: forall a b
. Lens' (NewtypedRecordWithTyVars a b)
{ first :: a
, second :: b
}
_NewtypedRecordWithTyVars = _Newtype
_NewtypedType :: Lens' NewtypedType Int
_NewtypedType = _Newtype
_DataDefinedInSourceFile :: Lens' DataDefinedInSourceFile Unit
_DataDefinedInSourceFile = iso (const unit) (const DataDefinedInSourceFile)
_NewtypeDefinedInSourceFile :: Lens' NewtypeDefinedInSourceFile Int
_NewtypeDefinedInSourceFile = _Newtype
_AliasDefinedInSourceFile :: Iso' AliasDefinedInSourceFile Int
_AliasDefinedInSourceFile = identity
_Data_Product_ImportedTypesAreReimported :: Lens' Data_Product_ImportedTypesAreReimported
{ arg1 ::
(MyData Int Int Int)
, arg2 :: (MyAlias String)
, arg3 :: (MyNewtype Int Int Int)
, arg4 ::
(Q.MyData Int Int Int)
, arg5 :: (Q.MyAlias String)
, arg6 :: (Q.MyNewtype Int Int Int)
, arg7 ::
(Shared.MyData Int Int Int)
, arg8 :: (Shared.MyAlias String)
, arg9 :: (Shared.MyNewtype Int Int Int)
, arg10 ::
DataDefinedInSourceFile
, arg11 :: NewtypeDefinedInSourceFile
, arg12 :: AliasDefinedInSourceFile
, arg13 :: FfiTypeDefinedInSourceFile
}
_Data_Product_ImportedTypesAreReimported = iso
( \( Data_Product_ImportedTypesAreReimported arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10
arg11
arg12
arg13
) ->
{ arg1: arg1
, arg2: arg2
, arg3: arg3
, arg4: arg4
, arg5: arg5
, arg6: arg6
, arg7: arg7
, arg8: arg8
, arg9: arg9
, arg10: arg10
, arg11: arg11
, arg12: arg12
, arg13: arg13
}
)
\{ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 } ->
Data_Product_ImportedTypesAreReimported arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11
arg12
arg13
_Data_Sum_ImportedTypesAreReimported :: Prism' Data_Sum_ImportedTypesAreReimported
{ arg1 ::
(MyData Int Int Int)
, arg2 :: (MyAlias String)
, arg3 :: (MyNewtype Int Int Int)
, arg4 ::
(Q.MyData Int Int Int)
, arg5 :: (Q.MyAlias String)
, arg6 :: (Q.MyNewtype Int Int Int)
, arg7 ::
(Shared.MyData Int Int Int)
, arg8 :: (Shared.MyAlias String)
, arg9 :: (Shared.MyNewtype Int Int Int)
, arg10 ::
DataDefinedInSourceFile
, arg11 :: NewtypeDefinedInSourceFile
, arg12 :: AliasDefinedInSourceFile
, arg13 :: FfiTypeDefinedInSourceFile
}
_Data_Sum_ImportedTypesAreReimported = prism
( \{ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 } ->
Data_Sum_ImportedTypesAreReimported arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11
arg12
arg13
)
case _ of
Data_Sum_ImportedTypesAreReimported arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11
arg12
arg13 -> Right
{ arg1: arg1
, arg2: arg2
, arg3: arg3
, arg4: arg4
, arg5: arg5
, arg6: arg6
, arg7: arg7
, arg8: arg8
, arg9: arg9
, arg10: arg10
, arg11: arg11
, arg12: arg12
, arg13: arg13
}
other -> Left other
_Data_Sum_ImportedTypesAreReimported_IgnoredCase :: Prism' Data_Sum_ImportedTypesAreReimported Unit
_Data_Sum_ImportedTypesAreReimported_IgnoredCase = prism
(const Data_Sum_ImportedTypesAreReimported_IgnoredCase)
case _ of
Data_Sum_ImportedTypesAreReimported_IgnoredCase -> Right unit
other -> Left other
_Record_ImportedTypesAreReimported :: Lens' Record_ImportedTypesAreReimported
{ noAlias ::
{ myData :: MyData Int Int Int
, myAlias :: MyAlias String
, myNewtype :: MyNewtype Int Int Int
}
, aliasOnly ::
{ myData :: Q.MyData Int Int Int
, myAlias :: Q.MyAlias String
, myNewtype :: Q.MyNewtype Int Int Int
}
, sharedAlias ::
{ myData :: Shared.MyData Int Int Int
, myAlias :: Shared.MyAlias String
, myNewtype :: Shared.MyNewtype Int Int Int
}
, definedInSourceFile ::
{ myData :: DataDefinedInSourceFile
, myAlias :: AliasDefinedInSourceFile
, myNewtype :: NewtypeDefinedInSourceFile
, myFfi :: FfiTypeDefinedInSourceFile
}
}
_Record_ImportedTypesAreReimported = _Newtype
_Data_TypeExported_CtorExported_Product_All :: Lens' Data_TypeExported_CtorExported_Product_All
Unit
_Data_TypeExported_CtorExported_Product_All = iso (const unit)
(const Data_TypeExported_CtorExported_Product_All)
_Data_TypeExported_CtorExported_Sum_All_1 :: Prism' Data_TypeExported_CtorExported_Sum_All Unit
_Data_TypeExported_CtorExported_Sum_All_1 = prism (const Data_TypeExported_CtorExported_Sum_All_1)
case _ of
Data_TypeExported_CtorExported_Sum_All_1 -> Right unit
other -> Left other
_Data_TypeExported_CtorExported_Sum_All_2 :: Prism' Data_TypeExported_CtorExported_Sum_All Unit
_Data_TypeExported_CtorExported_Sum_All_2 = prism (const Data_TypeExported_CtorExported_Sum_All_2)
case _ of
Data_TypeExported_CtorExported_Sum_All_2 -> Right unit
other -> Left other
_TypeAlias_TypeExported :: Iso' TypeAlias_TypeExported Int
_TypeAlias_TypeExported = identity
_Newtype_TypeExported_CtorExported_All :: Lens' Newtype_TypeExported_CtorExported_All Int
_Newtype_TypeExported_CtorExported_All = _Newtype
_Newtype_TypeExported_CtorExported_ByName :: Lens' Newtype_TypeExported_CtorExported_ByName Int
_Newtype_TypeExported_CtorExported_ByName = _Newtype
_KindedTyVars :: forall f. Lens' (KindedTyVars f) Unit
_KindedTyVars = iso (const unit) (const KindedTyVars)
_EnsureSharedImportIsUsed :: Lens' EnsureSharedImportIsUsed
{ arg1 ::
(Shared.SharedMyData Int Int Int)
, arg2 :: (Shared.SharedMyAlias String)
, arg3 :: (Shared.SharedMyNewtype Int Int Int)
}
_EnsureSharedImportIsUsed = iso
(\(EnsureSharedImportIsUsed arg1 arg2 arg3) -> { arg1: arg1, arg2: arg2, arg3: arg3 })
\{ arg1, arg2, arg3 } -> EnsureSharedImportIsUsed arg1 arg2 arg3
_propAliasOnly :: forall r a. Lens' { aliasOnly :: a | r } a
_propAliasOnly = prop (Proxy :: Proxy "aliasOnly")
_propArg1 :: forall r a. Lens' { arg1 :: a | r } a
_propArg1 = prop (Proxy :: Proxy "arg1")
_propArg10 :: forall r a. Lens' { arg10 :: a | r } a
_propArg10 = prop (Proxy :: Proxy "arg10")
_propArg11 :: forall r a. Lens' { arg11 :: a | r } a
_propArg11 = prop (Proxy :: Proxy "arg11")
_propArg12 :: forall r a. Lens' { arg12 :: a | r } a
_propArg12 = prop (Proxy :: Proxy "arg12")
_propArg13 :: forall r a. Lens' { arg13 :: a | r } a
_propArg13 = prop (Proxy :: Proxy "arg13")
_propArg2 :: forall r a. Lens' { arg2 :: a | r } a
_propArg2 = prop (Proxy :: Proxy "arg2")
_propArg3 :: forall r a. Lens' { arg3 :: a | r } a
_propArg3 = prop (Proxy :: Proxy "arg3")
_propArg4 :: forall r a. Lens' { arg4 :: a | r } a
_propArg4 = prop (Proxy :: Proxy "arg4")
_propArg5 :: forall r a. Lens' { arg5 :: a | r } a
_propArg5 = prop (Proxy :: Proxy "arg5")
_propArg6 :: forall r a. Lens' { arg6 :: a | r } a
_propArg6 = prop (Proxy :: Proxy "arg6")
_propArg7 :: forall r a. Lens' { arg7 :: a | r } a
_propArg7 = prop (Proxy :: Proxy "arg7")
_propArg8 :: forall r a. Lens' { arg8 :: a | r } a
_propArg8 = prop (Proxy :: Proxy "arg8")
_propArg9 :: forall r a. Lens' { arg9 :: a | r } a
_propArg9 = prop (Proxy :: Proxy "arg9")
_propBar :: forall r a. Lens' { bar :: a | r } a
_propBar = prop (Proxy :: Proxy "bar")
_propBaz :: forall r a. Lens' { baz :: a | r } a
_propBaz = prop (Proxy :: Proxy "baz")
_propDefinedInSourceFile :: forall r a. Lens' { definedInSourceFile :: a | r } a
_propDefinedInSourceFile = prop (Proxy :: Proxy "definedInSourceFile")
_propFirst :: forall r a. Lens' { first :: a | r } a
_propFirst = prop (Proxy :: Proxy "first")
_propNoAlias :: forall r a. Lens' { noAlias :: a | r } a
_propNoAlias = prop (Proxy :: Proxy "noAlias")
_propRecordFieldReferencedInExportedData
:: forall r a. Lens' { recordFieldReferencedInExportedData :: a | r } a
_propRecordFieldReferencedInExportedData = prop
(Proxy :: Proxy "recordFieldReferencedInExportedData")
_propRecordFieldReferencedInExportedTypeAlias
:: forall r a. Lens' { recordFieldReferencedInExportedTypeAlias :: a | r } a
_propRecordFieldReferencedInExportedTypeAlias = prop
(Proxy :: Proxy "recordFieldReferencedInExportedTypeAlias")
_propSecond :: forall r a. Lens' { second :: a | r } a
_propSecond = prop (Proxy :: Proxy "second")
_propSharedAlias :: forall r a. Lens' { sharedAlias :: a | r } a
_propSharedAlias = prop (Proxy :: Proxy "sharedAlias")