hpastetwo

haskell-src-exts useful

author
morrow
age
422 days
language
haskell
 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
-- haskell-src-exts boot

ghci> :m + Language.Haskell.Exts
ghci> :m + Language.Haskell.Exts.Syntax
ghci> :m + Language.Haskell.Exts.Parser
ghci> :m + Language.Haskell.Exts.Pretty
ghci> :m + Text.PrettyPrint

ghci> let pMod s = case parseModule s of ParseOk m -> Right m; ParseFailed loc err -> Left (show loc ++ ":" ++ err)
ghci> let pDecs s = case pMod s of Left e -> Left e; Right (Module _ _ _ _ _ _ decs) -> Right decs
ghci> let pExp s = case pDecs ("goo = " ++ s ++ "\n") of Left e -> Left e; Right decs -> case [ e | PatBind _ _ _ (UnGuardedRhs e) _ <- decs ] of e:_ -> Right e; _ -> Left "shouldn't happen"

ghci> let pp a = (text . prettyPrint) a
ghci> let ppMod s = either text pp (pMod s)
ghci> let ppDecs s = either text (vcat . fmap pp) (pDecs s)
ghci> let ppExp s = either text pp (pExp s)

-- i use this function 100 times a day
ghci> let ppHs a = ppExp (show a)

ghci> ppHs (Data.IntMap.fromList (zip [0..] ['a'..'z']))
fromList
  [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd'), (4, 'e'), (5, 'f'),
   (6, 'g'), (7, 'h'), (8, 'i'), (9, 'j'), (10, 'k'), (11, 'l'),
   (12, 'm'), (13, 'n'), (14, 'o'), (15, 'p'), (16, 'q'), (17, 'r'),
   (18, 's'), (19, 't'), (20, 'u'), (21, 'v'), (22, 'w'), (23, 'x'),
   (24, 'y'), (25, 'z')]


ghci> :! echo -ne 'module Fib where\nfib :: [Int]\nfib = let go m n = m : go n (m+n) in go 0 1\n' > Fib.hs
ghci> a <- readFile "Fib.hs"


ghci> let Right m = pMod a

-- concrete
ghci> pp m
module Fib where
 
fib :: [Int]
fib = let go m n = m : go n (m + n) in go 0 1
ghci> 

-- abstract (this output could be parsed again with pExp, and so on ad inifinitum)
ghci> ppHs m
Module
  (SrcLoc{srcFilename = "<unknown>.hs", srcLine = 1, srcColumn = 1})
  (ModuleName "Fib")
  []
  Nothing
  Nothing
  []
  [TypeSig
     (SrcLoc{srcFilename = "<unknown>.hs", srcLine = 2, srcColumn = 1})
     [Ident "fib"]
     (TyApp (TyCon (Special ListCon)) (TyCon (UnQual (Ident "Int")))),
   PatBind
     (SrcLoc{srcFilename = "<unknown>.hs", srcLine = 3, srcColumn = 1})
     (PVar (Ident "fib"))
     Nothing
     (UnGuardedRhs
        (Let
           (BDecls
              [FunBind
                 [Match
                    (SrcLoc{srcFilename = "<unknown>.hs", srcLine = 3, srcColumn = 11})
                    (Ident "go")
                    [PVar (Ident "m"), PVar (Ident "n")]
                    Nothing
                    (UnGuardedRhs
                       (InfixApp (Var (UnQual (Ident "m"))) (QConOp (Special Cons))
                          (App (App (Var (UnQual (Ident "go"))) (Var (UnQual (Ident "n"))))
                             (Paren
                                (InfixApp (Var (UnQual (Ident "m"))) (QVarOp (UnQual (Symbol "+")))
                                   (Var (UnQual (Ident "n"))))))))
                    (BDecls [])]])
           (App (App (Var (UnQual (Ident "go"))) (Lit (Int 0)))
              (Lit (Int 1)))))
     (BDecls [])]
ghci> 

this pExp is better

author
morrow
age
422 days
language
haskell
1
ghci> let pExp s = case pDecs ("goo = " ++ unlines (fmap ("  "++) (lines s))) of Left e -> Left e; Right decs -> case [ e | PatBind _ _ _ (UnGuardedRhs e) _ <- decs ] of e:_ -> Right e; _ -> Left "shouldn't happen"

pretty package.conf

author
morrow
age
422 days
language
haskell
  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
ghci> a <- readFile "/usr/local/ghc/ghc-6.10.1/lib/ghc-6.10.1/package.conf"
ghci> let Right e = pExp a                                                                                                       ghci> ppHs e                                                                                                                     List
  [RecConstr (UnQual (Ident "InstalledPackageInfo"))
     [FieldUpdate (UnQual (Ident "package"))
        (RecConstr (UnQual (Ident "PackageIdentifier"))
           [FieldUpdate (UnQual (Ident "pkgName"))
              (App (Con (UnQual (Ident "PackageName")))
                 (Lit (String "haddock"))),
            FieldUpdate (UnQual (Ident "pkgVersion"))
              (RecConstr (UnQual (Ident "Version"))
                 [FieldUpdate (UnQual (Ident "versionBranch"))
                    (List [Lit (Int 2), Lit (Int 3), Lit (Int 0)]),
                  FieldUpdate (UnQual (Ident "versionTags")) (List [])])]),
      FieldUpdate (UnQual (Ident "license"))
        (Con (UnQual (Ident "BSD3"))),
      FieldUpdate (UnQual (Ident "copyright"))
        (Lit (String "(c) Simon Marlow, David Waern")),
      FieldUpdate (UnQual (Ident "maintainer"))
        (Lit (String "David Waern <david.waern@gmail.com>")),
      FieldUpdate (UnQual (Ident "author"))
        (Lit (String "Simon Marlow, David Waern")),
      FieldUpdate (UnQual (Ident "stability"))
        (Lit (String "experimental")),
      FieldUpdate (UnQual (Ident "homepage"))
        (Lit (String "http://www.haskell.org/haddock/")),
      FieldUpdate (UnQual (Ident "pkgUrl")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "description"))
        (Lit
           (String
              "Haddock is a documentation-generation tool for Haskell\nlibraries")),
      FieldUpdate (UnQual (Ident "category"))
        (Lit (String "Development")),
      FieldUpdate (UnQual (Ident "exposed"))
        (Con (UnQual (Ident "True"))),
      FieldUpdate (UnQual (Ident "exposedModules"))
        (List [Lit (String "Distribution.Haddock")]),
      FieldUpdate (UnQual (Ident "hiddenModules"))
        (List
           [Lit (String "Haddock.Types"),
            Lit (String "Haddock.InterfaceFile"),
            Lit (String "Haddock.Exception")]),
      FieldUpdate (UnQual (Ident "importDirs"))
        (List
           [Lit
              (String
                 "/usr/local/ghc/ghc-6.10.1/lib/ghc-6.10.1/haddock-2.3.0")]),
      FieldUpdate (UnQual (Ident "libraryDirs"))
        (List
           [Lit
              (String
                 "/usr/local/ghc/ghc-6.10.1/lib/ghc-6.10.1/haddock-2.3.0")]),
      FieldUpdate (UnQual (Ident "hsLibraries"))
        (List [Lit (String "HShaddock-2.3.0")]),
      FieldUpdate (UnQual (Ident "extraLibraries")) (List []),
      FieldUpdate (UnQual (Ident "extraGHCiLibraries")) (List []),
      FieldUpdate (UnQual (Ident "includeDirs")) (List []),
      FieldUpdate (UnQual (Ident "includes")) (List []),
      FieldUpdate (UnQual (Ident "depends"))
        (List
           [RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName"))) (Lit (String "Cabal"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 1), Lit (Int 6), Lit (Int 0), Lit (Int 1)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName"))) (Lit (String "array"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 0), Lit (Int 2), Lit (Int 0), Lit (Int 0)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName"))) (Lit (String "base"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 4), Lit (Int 0), Lit (Int 0), Lit (Int 0)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName")))
                    (Lit (String "containers"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 0), Lit (Int 2), Lit (Int 0), Lit (Int 0)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName")))
                    (Lit (String "directory"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 1), Lit (Int 0), Lit (Int 0), Lit (Int 2)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName")))
                    (Lit (String "filepath"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 1), Lit (Int 1), Lit (Int 0), Lit (Int 1)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName"))) (Lit (String "ghc"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 6), Lit (Int 10), Lit (Int 1)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName")))
                    (Lit (String "haskell98"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 1), Lit (Int 0), Lit (Int 1), Lit (Int 0)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])],
            RecConstr (UnQual (Ident "PackageIdentifier"))
              [FieldUpdate (UnQual (Ident "pkgName"))
                 (App (Con (UnQual (Ident "PackageName"))) (Lit (String "pretty"))),
               FieldUpdate (UnQual (Ident "pkgVersion"))
                 (RecConstr (UnQual (Ident "Version"))
                    [FieldUpdate (UnQual (Ident "versionBranch"))
                       (List [Lit (Int 1), Lit (Int 0), Lit (Int 1), Lit (Int 0)]),
                     FieldUpdate (UnQual (Ident "versionTags")) (List [])])]]),
      FieldUpdate (UnQual (Ident "hugsOptions")) (List []),
      FieldUpdate (UnQual (Ident "ccOptions")) (List []),
      FieldUpdate (UnQual (Ident "ldOptions")) (List []),
      FieldUpdate (UnQual (Ident "frameworkDirs")) (List []),
      FieldUpdate (UnQual (Ident "frameworks")) (List []),
      FieldUpdate (UnQual (Ident "haddockInterfaces"))
        (List [Lit (String "haddock.haddock")]),
      FieldUpdate (UnQual (Ident "haddockHTMLs"))
        (List [Lit (String "/usr/local/ghc/ghc-6.10.1/share/doc/ghc")])],
   RecConstr (UnQual (Ident "InstalledPackageInfo"))
     [FieldUpdate (UnQual (Ident "package"))
        (RecConstr (UnQual (Ident "PackageIdentifier"))
           [FieldUpdate (UnQual (Ident "pkgName"))
              (App (Con (UnQual (Ident "PackageName"))) (Lit (String "rts"))),
            FieldUpdate (UnQual (Ident "pkgVersion"))
              (RecConstr (UnQual (Ident "Version"))
                 [FieldUpdate (UnQual (Ident "versionBranch"))
                    (List [Lit (Int 1), Lit (Int 0)]),
                  FieldUpdate (UnQual (Ident "versionTags")) (List [])])]),
      FieldUpdate (UnQual (Ident "license"))
        (Con (UnQual (Ident "BSD3"))),
      FieldUpdate (UnQual (Ident "copyright")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "maintainer"))
        (Lit (String "glasgow-haskell-users@haskell.org")),
      FieldUpdate (UnQual (Ident "author")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "stability")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "homepage")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "pkgUrl")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "description")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "category")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "exposed"))
        (Con (UnQual (Ident "True"))),
      FieldUpdate (UnQual (Ident "exposedModules")) (List []),
      FieldUpdate (UnQual (Ident "hiddenModules")) (List []),
      FieldUpdate (UnQual (Ident "importDirs")) (List []),
      FieldUpdate (UnQual (Ident "libraryDirs"))
        (List [Lit (String "/usr/local/ghc/ghc-6.10.1/lib/ghc-6.10.1")]),
      FieldUpdate (UnQual (Ident "hsLibraries"))
        (List [Lit (String "HSrts")]),
      FieldUpdate (UnQual (Ident "extraLibraries"))
        (List
           [Lit (String "m"), Lit (String "ffi"), Lit (String "gmp"),
            Lit (String "dl"), Lit (String "rt")]),
      FieldUpdate (UnQual (Ident "extraGHCiLibraries")) (List []),
      FieldUpdate (UnQual (Ident "includeDirs"))
        (List
           [Lit (String "/usr/local/ghc/ghc-6.10.1/lib/ghc-6.10.1/include"),
            Lit (String "PAPI_INCLUDE_DIR")]),
      FieldUpdate (UnQual (Ident "includes"))
        (List [Lit (String "Stg.h")]),
      FieldUpdate (UnQual (Ident "depends")) (List []),
      FieldUpdate (UnQual (Ident "hugsOptions")) (List []),
      FieldUpdate (UnQual (Ident "ccOptions")) (List []),
      FieldUpdate (UnQual (Ident "ldOptions"))
        (List
           [Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Izh_static_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Czh_static_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Fzh_static_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Dzh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziPtr_Ptr_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziWord_Wzh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziInt_I8zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziInt_I16zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziInt_I32zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziInt_I64zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziWord_W8zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziWord_W16zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziWord_W32zh_static_info"),
            Lit (String "-u"), Lit (String "base_GHCziWord_W64zh_static_info"),
            Lit (String "-u"),
            Lit (String "base_GHCziStable_StablePtr_static_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Izh_con_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Czh_con_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Fzh_con_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziTypes_Dzh_con_info"),
            Lit (String "-u"), Lit (String "base_GHCziPtr_Ptr_con_info"),
            Lit (String "-u"), Lit (String "base_GHCziPtr_FunPtr_con_info"),
            Lit (String "-u"),
            Lit (String "base_GHCziStable_StablePtr_con_info"),
            Lit (String "-u"),
            Lit (String "ghczmprim_GHCziBool_False_closure"),
            Lit (String "-u"), Lit (String "ghczmprim_GHCziBool_True_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziPack_unpackCString_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziIOBase_stackOverflow_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziIOBase_heapOverflow_closure"),
            Lit (String "-u"),
            Lit
              (String "base_ControlziExceptionziBase_nonTermination_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziIOBase_blockedOnDeadMVar_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziIOBase_blockedIndefinitely_closure"),
            Lit (String "-u"),
            Lit
              (String "base_ControlziExceptionziBase_nestedAtomically_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziWeak_runFinalizzerBatch_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziTopHandler_runIO_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziTopHandler_runNonIO_closure"),
            Lit (String "-u"),
            Lit (String "base_GHCziConc_ensureIOManagerIsRunning_closure")]),
      FieldUpdate (UnQual (Ident "frameworkDirs")) (List []),
      FieldUpdate (UnQual (Ident "frameworks")) (List []),
      FieldUpdate (UnQual (Ident "haddockInterfaces")) (List []),
      FieldUpdate (UnQual (Ident "haddockHTMLs")) (List [])],
   RecConstr (UnQual (Ident "InstalledPackageInfo"))
     [FieldUpdate (UnQual (Ident "package"))
        (RecConstr (UnQual (Ident "PackageIdentifier"))
           [FieldUpdate (UnQual (Ident "pkgName"))
              (App (Con (UnQual (Ident "PackageName"))) (Lit (String "ghc"))),
            FieldUpdate (UnQual (Ident "pkgVersion"))
              (RecConstr (UnQual (Ident "Version"))
                 [FieldUpdate (UnQual (Ident "versionBranch"))
                    (List [Lit (Int 6), Lit (Int 10), Lit (Int 1)]),
                  FieldUpdate (UnQual (Ident "versionTags")) (List [])])]),
      FieldUpdate (UnQual (Ident "license"))
        (Con (UnQual (Ident "BSD3"))),
      FieldUpdate (UnQual (Ident "copyright")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "maintainer"))
        (Lit (String "glasgow-haskell-users@haskell.org")),
      FieldUpdate (UnQual (Ident "author"))
        (Lit (String "The GHC Team")),
      FieldUpdate (UnQual (Ident "stability")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "homepage"))
        (Lit (String "http://www.haskell.org/ghc/")),
      FieldUpdate (UnQual (Ident "pkgUrl")) (Lit (String "")),
      FieldUpdate (UnQual (Ident "description"))
        (Lit
           (String
              "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.")),
      FieldUpdate (UnQual (Ident "category"))
        (Lit (String "Development")),
      FieldUpdate (UnQual (Ident "exposed"))
        (Con (UnQual (Ident "True"))),
      FieldUpdate (UnQual (Ident "exposedModules"))
        (List
           [Lit (String "AsmCodeGen"), Lit (String "MachCodeGen"),
            Lit (String "MachInstrs"), Lit (String "MachRegs"),
            Lit (String "NCGMonad"), Lit (String "PositionIndependentCode"),
            Lit (String "PprMach"), Lit (String "RegAllocColor"),
            Lit (String "RegAllocInfo"), Lit (String "RegAllocLinear"),
            Lit (String "RegAllocStats"), Lit (String "RegArchBase"),
            Lit (String "RegArchX86"), Lit (String "RegCoalesce"),
            Lit (String "RegLiveness"), Lit (String "RegSpill"),
            Lit (String "RegSpillClean"), Lit (String "RegSpillCost"),
            Lit (String "DsMeta"), Lit (String "TcSplice"),
            Lit (String "Convert"), Lit (String "ByteCodeAsm"),
            Lit (String "ByteCodeFFI"), Lit (String "ByteCodeGen"),
            Lit (String "ByteCodeInstr"), Lit (String "ByteCodeItbls"),
            Lit (String "ByteCodeLink"), Lit (String "Debugger"),
            Lit (String "GhciMonad"), Lit (String "GhciTags"),
            Lit (String "InteractiveUI"), Lit (String "LibFFI"),
            Lit (String "Linker"), Lit (String "ObjLink"),
            Lit (String "RtClosureInspect"), Lit (String "BasicTypes"),
            Lit (String "DataCon"), Lit (String "Demand"),
            Lit (String "Exception"), Lit (String "Id"), Lit (String "IdInfo"),
            Lit (String "Literal"), Lit (String "MkId"), Lit (String "Module"),
            Lit (String "Name"), Lit (String "NameEnv"),
            Lit (String "NameSet"), Lit (String "NewDemand"),
            Lit (String "OccName"), Lit (String "RdrName"),
            Lit (String "SrcLoc"), Lit (String "UniqSupply"),
            Lit (String "Unique"), Lit (String "Var"), Lit (String "VarEnv"),
            Lit (String "VarSet"), Lit (String "BlockId"),
            Lit (String "CLabel"), Lit (String "Cmm"),
            Lit (String "CmmBrokenBlock"), Lit (String "CmmCPS"),
            Lit (String "CmmCPSGen"), Lit (String "CmmCPSZ"),
            Lit (String "CmmCallConv"), Lit (String "CmmCommonBlockElimZ"),
            Lit (String "CmmContFlowOpt"), Lit (String "CmmCvt"),
            Lit (String "CmmExpr"), Lit (String "CmmInfo"),
            Lit (String "CmmLex"), Lit (String "CmmLint"),
            Lit (String "CmmLive"), Lit (String "CmmLiveZ"),
            Lit (String "CmmOpt"), Lit (String "CmmParse"),
            Lit (String "CmmProcPoint"), Lit (String "CmmProcPointZ"),
            Lit (String "CmmSpillReload"), Lit (String "CmmTx"),
            Lit (String "CmmUtils"), Lit (String "CmmZipUtil"),
            Lit (String "DFMonad"), Lit (String "Dataflow"),
            Lit (String "MachOp"), Lit (String "MkZipCfg"),
            Lit (String "MkZipCfgCmm"), Lit (String "OptimizationFuel"),
            Lit (String "PprC"), Lit (String "PprCmm"), Lit (String "PprCmmZ"),
            Lit (String "StackColor"), Lit (String "StackPlacements"),
            Lit (String "ZipCfg"), Lit (String "ZipCfgCmmRep"),
            Lit (String "ZipCfgExtras"), Lit (String "ZipDataflow"),
            Lit (String "Bitmap"), Lit (String "CgBindery"),
            Lit (String "CgCallConv"), Lit (String "CgCase"),
            Lit (String "CgClosure"), Lit (String "CgCon"),
            Lit (String "CgExpr"), Lit (String "CgForeignCall"),
            Lit (String "CgHeapery"), Lit (String "CgHpc"),
            Lit (String "CgInfoTbls"), Lit (String "CgLetNoEscape"),
            Lit (String "CgMonad"), Lit (String "CgParallel"),
            Lit (String "CgPrimOp"), Lit (String "CgProf"),
            Lit (String "CgStackery"), Lit (String "CgTailCall"),
            Lit (String "CgTicky"), Lit (String "CgUtils"),
            Lit (String "ClosureInfo"), Lit (String "CodeGen"),
            Lit (String "SMRep"), Lit (String "CoreFVs"),
            Lit (String "CoreLint"), Lit (String "CorePrep"),
            Lit (String "CoreSubst"), Lit (String "CoreSyn"),
            Lit (String "CoreTidy"), Lit (String "CoreUnfold"),
            Lit (String "CoreUtils"), Lit (String "ExternalCore"),
            Lit (String "MkCore"), Lit (String "MkExternalCore"),
            Lit (String "PprCore"), Lit (String "PprExternalCore"),
            Lit (String "CprAnalyse"), Lit (String "Check"),
            Lit (String "Coverage"), Lit (String "Desugar"),
            Lit (String "DsArrows"), Lit (String "DsBinds"),
            Lit (String "DsCCall"), Lit (String "DsExpr"),
            Lit (String "DsForeign"), Lit (String "DsGRHSs"),
            Lit (String "DsListComp"), Lit (String "DsMonad"),
            Lit (String "DsUtils"), Lit (String "Match"),
            Lit (String "MatchCon"), Lit (String "MatchLit"),
            Lit (String "HsBinds"), Lit (String "HsDecls"),
            Lit (String "HsDoc"), Lit (String "HsExpr"),
            Lit (String "HsImpExp"), Lit (String "HsLit"),
            Lit (String "HsPat"), Lit (String "HsSyn"), Lit (String "HsTypes"),
            Lit (String "HsUtils"), Lit (String "BinIface"),
            Lit (String "BuildTyCl"), Lit (String "IfaceEnv"),
            Lit (String "IfaceSyn"), Lit (String "IfaceType"),
            Lit (String "LoadIface"), Lit (String "MkIface"),
            Lit (String "TcIface"), Lit (String "BreakArray"),
            Lit (String "CmdLineParser"), Lit (String "CodeOutput"),
            Lit (String "Config"), Lit (String "Constants"),
            Lit (String "DriverMkDepend"), Lit (String "DriverPhases"),
            Lit (String "DriverPipeline"), Lit (String "DynFlags"),
            Lit (String "ErrUtils"), Lit (String "Finder"), Lit (String "GHC"),
            Lit (String "HeaderInfo"), Lit (String "HscMain"),
            Lit (String "HscStats"), Lit (String "HscTypes"),
            Lit (String "InteractiveEval"), Lit (String "PackageConfig"),
            Lit (String "Packages"), Lit (String "ParsePkgConf"),
            Lit (String "PprTyThing"), Lit (String "StaticFlags"),
            Lit (String "StaticFlagParser"), Lit (String "SysTools"),
            Lit (String "TidyPgm"), Lit (String "Ctype"),
            Lit (String "HaddockLex"), Lit (String "HaddockParse"),
            Lit (String "HaddockUtils"), Lit (String "LexCore"),
            Lit (String "Lexer"), Lit (String "Parser"),
            Lit (String "ParserCore"), Lit (String "ParserCoreUtils"),
            Lit (String "RdrHsSyn"), Lit (String "ForeignCall"),
            Lit (String "PrelInfo"), Lit (String "PrelNames"),
            Lit (String "PrelRules"), Lit (String "PrimOp"),
            Lit (String "TysPrim"), Lit (String "TysWiredIn"),
            Lit (String "CostCentre"), Lit (String "SCCfinal"),
            Lit (String "RnBinds"), Lit (String "RnEnv"),
            Lit (String "RnExpr"), Lit (String "RnHsDoc"),
            Lit (String "RnHsSyn"), Lit (String "RnNames"),
            Lit (String "RnPat"), Lit (String "RnSource"),
            Lit (String "RnTypes"), Lit (String "CSE"), Lit (String "FloatIn"),
            Lit (String "FloatOut"), Lit (String "LiberateCase"),
            Lit (String "OccurAnal"), Lit (String "SAT"),
            Lit (String "SetLevels"), Lit (String "SimplCore"),
            Lit (String "SimplEnv"), Lit (String "SimplMonad"),
            Lit (String "SimplUtils"), Lit (String "Simplify"),
   ^C Interrupted.
ghci>